MCPcopy Index your code
hub / github.com/microsoft/typescript-go / addRootFileTask

Method addRootFileTask

internal/compiler/fileloader.go:202–227  ·  view source on GitHub ↗
(fileName string, libFile *LibFile, includeReason *FileIncludeReason)

Source from the content-addressed store, hash-verified

200}
201
202func (p *fileLoader) addRootFileTask(fileName string, libFile *LibFile, includeReason *FileIncludeReason) {
203 currDir := p.opts.Host.GetCurrentDirectory()
204 absPath := tspath.GetNormalizedAbsolutePath(fileName, currDir)
205 containingFile := currDir
206 if p.opts.Config.ConfigFile != nil {
207 containingFile = tspath.GetNormalizedAbsolutePath(p.opts.Config.ConfigFile.SourceFile.FileName(), currDir)
208 }
209 resolvedFile, diagnostic := p.getSourceFileFromReference(absPath, fileName, containingFile, includeReason)
210 rootTask := &parseTask{
211 normalizedFilePath: resolvedFile,
212 libFile: libFile,
213 includeReason: includeReason,
214 }
215 if diagnostic != nil {
216 rootTask.normalizedFilePath = absPath
217 rootTask.processingDiagnostics = []*processingDiagnostic{{
218 kind: processingDiagnosticKindExplainingFileInclude,
219 data: &includeExplainingDiagnostic{
220 diagnosticReason: includeReason,
221 message: diagnostic.message,
222 args: diagnostic.args,
223 },
224 }}
225 }
226 p.rootTasks = append(p.rootTasks, rootTask)
227}
228
229func (p *fileLoader) addAutomaticTypeDirectiveTasks() {
230 var containingDirectory string

Callers 1

processAllProgramFilesFunction · 0.95

Calls 5

GetCurrentDirectoryMethod · 0.65
FileNameMethod · 0.65
appendFunction · 0.50

Tested by

no test coverage detected