@@ -129,7 +129,7 @@ func (t *parseTask) load(loader *fileLoader) {
129129 includeReason : includeReason ,
130130 }, libFile )
131131 } else {
132- loader . includeProcessor . addProcessingDiagnostic ( & processingDiagnostic {
132+ t . processingDiagnostics = append ( t . processingDiagnostics , & processingDiagnostic {
133133 kind : processingDiagnosticKindUnknownReference ,
134134 data : includeReason ,
135135 })
@@ -268,7 +268,9 @@ func (w *filesParser) getProcessedFiles(loader *fileLoader) processedFiles {
268268 tasksSeenByNameIgnoreCase = make (map [string ]* parseTask , totalFileCount )
269269 }
270270
271- loader .includeProcessor .fileIncludeReasons = make (map [tspath.Path ][]* FileIncludeReason , totalFileCount )
271+ includeProcessor := & includeProcessor {
272+ fileIncludeReasons : make (map [tspath.Path ][]* FileIncludeReason , totalFileCount ),
273+ }
272274 var outputFileToProjectReferenceSource map [tspath.Path ]string
273275 if ! loader .opts .canUseProjectReferenceSource () {
274276 outputFileToProjectReferenceSource = make (map [tspath.Path ]string , totalFileCount )
@@ -292,7 +294,7 @@ func (w *filesParser) getProcessedFiles(loader *fileLoader) processedFiles {
292294 if task .loadedTask != nil {
293295 task = task .loadedTask
294296 }
295- w .addIncludeReason (loader , task , includeReason )
297+ w .addIncludeReason (includeProcessor , task , includeReason )
296298 }
297299 data , _ := w .taskDataByPath .Load (task .path )
298300 if ! task .loaded {
@@ -306,7 +308,7 @@ func (w *filesParser) getProcessedFiles(loader *fileLoader) processedFiles {
306308 checkedAbsolutePath := tspath .GetNormalizedAbsolutePathWithoutRoot (checkedName , loader .comparePathsOptions .CurrentDirectory )
307309 inputAbsolutePath := tspath .GetNormalizedAbsolutePathWithoutRoot (task .normalizedFilePath , loader .comparePathsOptions .CurrentDirectory )
308310 if checkedAbsolutePath != inputAbsolutePath {
309- loader . includeProcessor .addProcessingDiagnosticsForFileCasing (task .path , checkedName , task .normalizedFilePath , includeReason )
311+ includeProcessor .addProcessingDiagnosticsForFileCasing (task .path , checkedName , task .normalizedFilePath , includeReason )
310312 }
311313 }
312314 continue
@@ -317,7 +319,7 @@ func (w *filesParser) getProcessedFiles(loader *fileLoader) processedFiles {
317319 if tasksSeenByNameIgnoreCase != nil {
318320 pathLowerCase := tspath .ToFileNameLowerCase (string (task .path ))
319321 if taskByIgnoreCase , ok := tasksSeenByNameIgnoreCase [pathLowerCase ]; ok {
320- loader . includeProcessor .addProcessingDiagnosticsForFileCasing (taskByIgnoreCase .path , taskByIgnoreCase .normalizedFilePath , task .normalizedFilePath , includeReason )
322+ includeProcessor .addProcessingDiagnosticsForFileCasing (taskByIgnoreCase .path , taskByIgnoreCase .normalizedFilePath , task .normalizedFilePath , includeReason )
321323 } else {
322324 tasksSeenByNameIgnoreCase [pathLowerCase ] = task
323325 }
@@ -351,7 +353,7 @@ func (w *filesParser) getProcessedFiles(loader *fileLoader) processedFiles {
351353 path := task .path
352354
353355 if len (task .processingDiagnostics ) > 0 {
354- loader . includeProcessor .processingDiagnostics = append (loader . includeProcessor .processingDiagnostics , task .processingDiagnostics ... )
356+ includeProcessor .processingDiagnostics = append (includeProcessor .processingDiagnostics , task .processingDiagnostics ... )
355357 }
356358
357359 if file == nil {
@@ -420,19 +422,19 @@ func (w *filesParser) getProcessedFiles(loader *fileLoader) processedFiles {
420422 sourceFilesFoundSearchingNodeModules : sourceFilesFoundSearchingNodeModules ,
421423 libFiles : libFilesMap ,
422424 missingFiles : missingFiles ,
423- includeProcessor : loader . includeProcessor ,
425+ includeProcessor : includeProcessor ,
424426 outputFileToProjectReferenceSource : outputFileToProjectReferenceSource ,
425427 }
426428}
427429
428- func (w * filesParser ) addIncludeReason (loader * fileLoader , task * parseTask , reason * FileIncludeReason ) {
430+ func (w * filesParser ) addIncludeReason (includeProcessor * includeProcessor , task * parseTask , reason * FileIncludeReason ) {
429431 if task .redirectedParseTask != nil {
430- w .addIncludeReason (loader , task .redirectedParseTask , reason )
432+ w .addIncludeReason (includeProcessor , task .redirectedParseTask , reason )
431433 } else if task .loaded {
432- if existing , ok := loader . includeProcessor .fileIncludeReasons [task .path ]; ok {
433- loader . includeProcessor .fileIncludeReasons [task .path ] = append (existing , reason )
434+ if existing , ok := includeProcessor .fileIncludeReasons [task .path ]; ok {
435+ includeProcessor .fileIncludeReasons [task .path ] = append (existing , reason )
434436 } else {
435- loader . includeProcessor .fileIncludeReasons [task .path ] = []* FileIncludeReason {reason }
437+ includeProcessor .fileIncludeReasons [task .path ] = []* FileIncludeReason {reason }
436438 }
437439 }
438440}
0 commit comments