refactor(language-service): Differentiate Inline and External template (#32127)
This commit creates two concrete classes Inline and External TemplateSource to differentiate between templates in TS file and HTML file. Knowing the template type makes the code much more explicit which filetype we are dealing with. With these two classes, there is no need for `getTemplateAt()` method in TypeScriptHost. Removing this method is safe since it is not used in the extension. This reduces the API surface of TypescriptHost. PR Close #32127
This commit is contained in:

committed by
Andrew Kushnir

parent
253a1125bf
commit
40b28742a9
@ -36,7 +36,7 @@ class LanguageServiceImpl implements LanguageService {
|
||||
const results: Diagnostic[] = [];
|
||||
const templates = this.host.getTemplates(fileName);
|
||||
for (const template of templates) {
|
||||
const ast = this.host.getTemplateAst(template, fileName);
|
||||
const ast = this.host.getTemplateAst(template);
|
||||
results.push(...getTemplateDiagnostics(template, ast));
|
||||
}
|
||||
const declarations = this.host.getDeclarations(fileName);
|
||||
|
Reference in New Issue
Block a user