refactor(compiler-cli): move getDiagnosticsForComponent to compiler (#43134)

Change the language service to call `getDiagnosticsForComponent` from
the compiler instead of the `TemplateTypeChecker`.

Refs #42966

PR Close #43134
This commit is contained in:
Daniel Trevino
2021-08-23 21:21:37 +00:00
committed by Alex Rickabaugh
parent 6af6de7328
commit 68bb13ea0f
2 changed files with 10 additions and 2 deletions
@@ -459,6 +459,15 @@ export class NgCompiler {
return this.addMessageTextDetails(diagnostics);
}
/**
* Get all `ts.Diagnostic`s currently available that pertain to the given component.
*/
getDiagnosticsForComponent(component: ts.ClassDeclaration): ts.Diagnostic[] {
const compilation = this.ensureAnalyzed();
const ttc = compilation.templateTypeChecker;
return this.addMessageTextDetails(ttc.getDiagnosticsForComponent(component));
}
/**
* Add Angular.io error guide links to diagnostics for this compilation.
*/