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

Method getSourceFile

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

Source from the content-addressed store, hash-verified

432 private writtenFiles = new Set<string>();
433
434 override getSourceFile(
435 fileName: string,
436 languageVersion: ts.ScriptTarget,
437 onError?: (message: string) => void,
438 shouldCreateNewSourceFile?: boolean,
439 ): ts.SourceFile | undefined {
440 if (this.cache.has(fileName)) {
441 return this.cache.get(fileName)!;
442 }
443 const sf = super.getSourceFile(fileName, languageVersion);
444 if (sf !== undefined) {
445 this.cache.set(sf.fileName, sf);
446 }
447 return sf;
448 }
449
450 flushWrittenFileTracking(): void {
451 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