AngularAstAnalyzer
Defined in: packages/analyzer/src/analyzers/angular/angular-analyzer.ts:105
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AngularAstAnalyzer(): AngularAstAnalyzer;Returns
Section titled “Returns”AngularAstAnalyzer
Methods
Section titled “Methods”analyzeFile()
Section titled “analyzeFile()”analyzeFile(filePath): FileAnalysis;Defined in: packages/analyzer/src/analyzers/angular/angular-analyzer.ts:137
Analyze a single TypeScript file.
Prefers a SourceFile from the configured ts.Program (so the type checker
can resolve literal unions on the same AST nodes we extract). Falls back to
a fresh ts.createSourceFile parse when no program is set or the file is
not part of it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
filePath |
string |
Returns
Section titled “Returns”resolveUnionLiterals()
Section titled “resolveUnionLiterals()”resolveUnionLiterals(typeNode, sourceFile): ResolveUnionResult;Defined in: packages/analyzer/src/analyzers/angular/angular-analyzer.ts:863
Resolve literal union values for a type node using the TypeChecker.
Returns a discriminated result distinguishing the four failure modes from
success. Operates on the AST node directly — Phase 2 removed the position-
matching hack now that analyzeFile reuses the program’s SourceFile.
If typeNode is undefined the caller has nothing to resolve; we report
not-union (no union type to talk about) without emitting a diagnostic.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
typeNode |
TypeNode | undefined |
sourceFile |
SourceFile |
Returns
Section titled “Returns”ResolveUnionResult
setDiagnostics()
Section titled “setDiagnostics()”setDiagnostics(collector): void;Defined in: packages/analyzer/src/analyzers/angular/angular-analyzer.ts:125
Optional diagnostics collector. When set, non-ok outcomes from
resolveUnionLiterals are reported as severity: 'warn' with code
union-resolution-<kind>. Safe to leave unset (analyzer used outside the CLI).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
collector |
DiagnosticsCollector |
Returns
Section titled “Returns”void
setTypeChecker()
Section titled “setTypeChecker()”setTypeChecker(program): void;Defined in: packages/analyzer/src/analyzers/angular/angular-analyzer.ts:115
Set a TypeChecker for resolving literal union type values. When set, input properties will include resolvedValues for string/number literal unions.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
program |
Program |
Returns
Section titled “Returns”void