Skip to content

Commit 9c4f757

Browse files
committed
fix: ensure project language service is the Angular LS
Add check to ensure the returned language service for the project is the Angular Language Service. This removes the need for a type assertion and also prevents the native TS LS from taking the place of ours if there is an issue with the plugin registration (which would result in duplicate results in TS files). Fixes #1110.
1 parent 2a7e42c commit 9c4f757

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/src/session.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,12 @@ export class Session {
708708
this.logger.info(`Failed to get language service for closed project ${project.projectName}.`);
709709
return undefined;
710710
}
711+
const languageService = project.getLanguageService();
712+
if (!('getTcb' in languageService)) {
713+
return undefined;
714+
}
711715
return {
712-
languageService: project.getLanguageService() as NgLanguageService,
716+
languageService,
713717
scriptInfo,
714718
};
715719
}

0 commit comments

Comments
 (0)