Skip to content

Commit 6c4876a

Browse files
authored
Merge pull request microsoft#31270 from ajafff/getParsedCommandLine-path
parseProjectReferenceConfigFile: always set SourceFile.path
2 parents cc0e5a0 + 3c2f368 commit 6c4876a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/compiler/program.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2688,6 +2688,7 @@ namespace ts {
26882688
return undefined;
26892689
}
26902690
sourceFile = Debug.assertDefined(commandLine.options.configFile);
2691+
Debug.assert(!sourceFile.path || sourceFile.path === sourceFilePath);
26912692
addFileToFilesByName(sourceFile, sourceFilePath, /*redirectedPath*/ undefined);
26922693
}
26932694
else {
@@ -2699,11 +2700,12 @@ namespace ts {
26992700
projectReferenceRedirects.set(sourceFilePath, false);
27002701
return undefined;
27012702
}
2702-
sourceFile.path = sourceFilePath;
2703-
sourceFile.resolvedPath = sourceFilePath;
2704-
sourceFile.originalFileName = refPath;
27052703
commandLine = parseJsonSourceFileConfigFileContent(sourceFile, configParsingHost, basePath, /*existingOptions*/ undefined, refPath);
27062704
}
2705+
sourceFile.path = sourceFilePath;
2706+
sourceFile.resolvedPath = sourceFilePath;
2707+
sourceFile.originalFileName = refPath;
2708+
27072709
const resolvedRef: ResolvedProjectReference = { commandLine, sourceFile };
27082710
projectReferenceRedirects.set(sourceFilePath, resolvedRef);
27092711
if (commandLine.projectReferences) {

0 commit comments

Comments
 (0)