-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(language-service): force compileNonExportedClasses: false in LS (#…
…40092) Projects opened in the LS are often larger in scope than the compilation units seen by the compiler when actually building. For example, in the LS it's not uncommon for the project to include both application as well as test files. This can create issues when the combination of files results in errors that are not otherwise present - for example, if test files have inline NgModules that re-declare components (a common Angular pattern). Such code is valid when compiling the app only (test files are excluded, so only one declaration is seen by the compiler) or when compiling tests only (since tests run in JIT mode and are not seen by the AOT compiler), but when both sets of files are mixed into a single compilation unit, the compiler sees the double declaration as an error. This commit attempts to mitigate the problem by forcing the compiler flag `compileNonExportedClasses` to `false` in a LS context. When tests contain duplicate declarations, often such declarations are inline in specs and not exported from the top level, so this flag can be used to greatly improve the IDE experience. PR Close #40092
- Loading branch information
Showing
2 changed files
with
70 additions
and
1 deletion.
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