Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(language-service): force compileNonExportedClasses: false in LS #40092

Closed

Commits on Dec 11, 2020

  1. fix(language-service): force compileNonExportedClasses: false in LS

    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.
    alxhub committed Dec 11, 2020
    Configuration menu
    Copy the full SHA
    e738c1b View commit details
    Browse the repository at this point in the history