refactor(language-service): Remove redudant 'TemplateInfo' type (#32250)
The TemplateInfo type is an extension of AstResult, but it is not necessary at all. Instead, improve the current interface for AstResult by removing all optional fileds and include the TemplateSource in AstResult instead. PR Close #32250
This commit is contained in:
@ -8,6 +8,8 @@
|
||||
|
||||
import {getClassMembersFromDeclaration, getPipesTable, getSymbolQuery} from '@angular/compiler-cli';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {isAstResult} from './common';
|
||||
import * as ng from './types';
|
||||
import {TypeScriptServiceHost} from './typescript_host';
|
||||
|
||||
@ -67,7 +69,8 @@ abstract class BaseTemplate implements ng.TemplateSource {
|
||||
// TODO: There is circular dependency here between TemplateSource and
|
||||
// TypeScriptHost. Consider refactoring the code to break this cycle.
|
||||
const ast = this.host.getTemplateAst(this);
|
||||
return getPipesTable(sourceFile, program, typeChecker, ast.pipes || []);
|
||||
const pipes = isAstResult(ast) ? ast.pipes : [];
|
||||
return getPipesTable(sourceFile, program, typeChecker, pipes);
|
||||
});
|
||||
}
|
||||
return this.queryCache;
|
||||
|
Reference in New Issue
Block a user