-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: retain typecheck files after project reload
It turns out typecheck files are not retained even after the fix in angular/angular#40162. For a complete explanation of the situation, see prior issue: #1030 This is because even after adding the typecheck files to the list of files to retain, tsserver will still remove them from a project if they do not exist on disk: https://github.com/microsoft/TypeScript/blob/3c32f6e154ead6749b76ec9c19cbfdd2acad97d6/src/server/editorServices.ts#L2188-L2193 In order to force tsserver to retain the files, we need to fake their existence. This is done in the `ServerHost`. Admittedly, this is not a great fix because it relies on the knowledge of the typecheck file suffix, which is an implementation detail in the compiler. The alternative is to explore the concept of "dynamic files", which are files that exist only in memory and not on disk. This would require changes to the Ivy compiler and `@angular/language-service`. Ideally, the compiler should ask `@angular/language-service` how to name the typecheck files, so that the naming is dictated by LS rather than the compiler. fix #1090
- Loading branch information
Keen Yee Liau
committed
Mar 1, 2021
1 parent
dd91729
commit bc9d9fc
Showing
3 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters