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

Method getSourceFile

packages/compiler-cli/test/mocks.ts:144–155  ·  view source on GitHub ↗
(
    fileName: string,
    languageVersion: ts.ScriptTarget,
    onError?: (message: string) => void,
  )

Source from the content-addressed store, hash-verified

142 }
143
144 getSourceFile(
145 fileName: string,
146 languageVersion: ts.ScriptTarget,
147 onError?: (message: string) => void,
148 ): ts.SourceFile {
149 const sourceText = this.context.readFile(fileName);
150 if (sourceText != null) {
151 return ts.createSourceFile(fileName, sourceText, languageVersion);
152 } else {
153 return undefined!;
154 }
155 }
156
157 getDefaultLibFileName(options: ts.CompilerOptions): string {
158 return ts.getDefaultLibFileName(options);

Callers 15

hasInternalAnnotationMethod · 0.45
visitClassDeclarationMethod · 0.45
replaceNodeMethod · 0.45
removeNodeMethod · 0.45
insertPrecedingLineFunction · 0.45
getIdOfOutputFunction · 0.45
isOutputDeclarationFunction · 0.45
migrateMethod · 0.45
analyzeMethod · 0.45

Calls 1

readFileMethod · 0.65

Tested by

no test coverage detected