Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion internal/compiler/fileloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ func (p *fileLoader) addRootTask(fileName string, libFile *LibFile, includeReaso
p.rootTasks = append(p.rootTasks, &parseTask{
normalizedFilePath: absPath,
libFile: libFile,
root: true,
includeReason: includeReason,
})
}
Expand Down
7 changes: 5 additions & 2 deletions internal/compiler/filesparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ type parseTask struct {
subTasks []*parseTask
loaded bool
isForAutomaticTypeDirective bool
root bool
includeReason *fileIncludeReason

metadata ast.SourceFileMetaData
Expand Down Expand Up @@ -51,6 +50,10 @@ func (t *parseTask) Path() tspath.Path {
return t.path
}

func (t *parseTask) isRoot() bool {
return t.includeReason.kind == fileIncludeKindRootFile || t.includeReason.kind == fileIncludeKindLibFile
}

func (t *parseTask) load(loader *fileLoader) {
t.loaded = true
t.path = loader.toPath(t.normalizedFilePath)
Expand Down Expand Up @@ -201,7 +204,7 @@ func (w *filesParser) start(loader *fileLoader, tasks []*parseTask, depth int, i
startSubtasks = true
}

if !task.root && taskIsFromExternalLibrary && !loadedTask.fromExternalLibrary {
if !task.isRoot() && taskIsFromExternalLibrary && !loadedTask.fromExternalLibrary {
// If we're seeing this task now as an external library,
// reprocess its subtasks to ensure they are also marked as external.
loadedTask.fromExternalLibrary = true
Expand Down
Loading