refactor(compiler-cli): allow program strategies to opt out of inlining (#38105)
The template type-checking engine relies on the abstraction interface `TypeCheckingProgramStrategy` to create updated `ts.Program`s for template type-checking. The basic API is that the type-checking engine requests changes to certain files in the program, and the strategy provides an updated `ts.Program`. Typically, such changes are made to 'ngtypecheck' shim files, but certain conditions can cause template type-checking to require "inline" operations, which change user .ts files instead. The strategy used by 'ngc' (the `ReusedProgramStrategy`) supports these kinds of updates, but other clients such as the language service might not always support modifying user files. To accommodate this, the `TypeCheckingProgramStrategy` interface was modified to include a `supportsInlineOperations` flag. If an implementation specifies `false` for inline support, the template type-checking system will return diagnostics on components which would otherwise require inline operations. Closes #38059 PR Close #38105
This commit is contained in:

committed by
Michael Prentice

parent
79b5e1891d
commit
271e0f9896
@ -76,6 +76,7 @@ export class Compiler {
|
||||
function createTypeCheckingProgramStrategy(project: ts.server.Project):
|
||||
TypeCheckingProgramStrategy {
|
||||
return {
|
||||
supportsInlineOperations: false,
|
||||
shimPathForComponent(component: ts.ClassDeclaration): AbsoluteFsPath {
|
||||
return TypeCheckShimGenerator.shimFor(absoluteFromSourceFile(component.getSourceFile()));
|
||||
},
|
||||
|
Reference in New Issue
Block a user