MCPcopy Create free account
hub / github.com/angular/angular / getSourceFile

Method getSourceFile

packages/compiler-cli/test/ngtsc/env.ts:428–442  ·  view source on GitHub ↗
(
    fileName: string,
    languageVersion: ts.ScriptTarget,
    onError?: (message: string) => void,
    shouldCreateNewSourceFile?: boolean,
  )

Source from the content-addressed store, hash-verified

426 private writtenFiles = new Set<string>();
427
428 override getSourceFile(
429 fileName: string,
430 languageVersion: ts.ScriptTarget,
431 onError?: (message: string) => void,
432 shouldCreateNewSourceFile?: boolean,
433 ): ts.SourceFile | undefined {
434 if (this.cache.has(fileName)) {
435 return this.cache.get(fileName)!;
436 }
437 const sf = super.getSourceFile(fileName, languageVersion);
438 if (sf !== undefined) {
439 this.cache.set(sf.fileName, sf);
440 }
441 return sf;
442 }
443
444 flushWrittenFileTracking(): void {
445 this.writtenFiles.clear();

Callers 3

hmr_spec.tsFile · 0.45
driveHmrMethod · 0.45

Calls 3

hasMethod · 0.65
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected