mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
committed by
Alex Rickabaugh
parent
6af6de7328
commit
68bb13ea0f
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user