MCPcopy Index your code
hub / github.com/angular/angular / getTypeCheckInfoAtPosition

Function getTypeCheckInfoAtPosition

packages/language-service/src/utils/index.ts:177–192  ·  view source on GitHub ↗
(
  fileName: string,
  position: number,
  compiler: NgCompiler,
)

Source from the content-addressed store, hash-verified

175 * Retrieves the `ts.ClassDeclaration` at a location along with its template AST nodes.
176 */
177export function getTypeCheckInfoAtPosition(
178 fileName: string,
179 position: number,
180 compiler: NgCompiler,
181): TypeCheckInfo | undefined {
182 if (isTypeScriptFile(fileName)) {
183 const sf = compiler.getCurrentProgram().getSourceFile(fileName);
184 if (sf === undefined) {
185 return undefined;
186 }
187
188 return getInlineTypeCheckInfoAtPosition(sf, position, compiler);
189 } else {
190 return getFirstComponentForTemplateFile(fileName, compiler);
191 }
192}
193
194/**
195 * First, attempt to sort component declarations by file name.

Calls 5

getCurrentProgramMethod · 0.80
isTypeScriptFileFunction · 0.70
getSourceFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…