Fixes to ensure getDefinitionAndBoundSpan works correctly when using composite projects

Project references need to be detached from the project when closing project
In SourceMapDecoder handle when the redirected file to project reference is set as the output of the project
Keep configured project alive if project it references has open ref
Fixes #26164
This commit is contained in:
Sheetal Nandi
2018-08-02 15:33:22 -07:00
parent 9df88316a2
commit 46d223dc1b
5 changed files with 75 additions and 6 deletions
+3 -2
View File
@@ -100,7 +100,8 @@ namespace ts.sourcemaps {
// Lookup file in program, if provided
const path = toPath(fileName, location, host.getCanonicalFileName);
const file = program && program.getSourceFile(path);
if (!file) {
// file returned here could be .d.ts when asked for .ts file if projectReferences and module resolution created this source file
if (!file || file.resolvedPath !== path) {
// Otherwise check the cache (which may hit disk)
return fallbackCache.get(path);
}
@@ -373,4 +374,4 @@ namespace ts.sourcemaps {
encodedText.charCodeAt(pos) === CharacterCodes.comma ||
encodedText.charCodeAt(pos) === CharacterCodes.semicolon);
}
}
}