Fix the issue with file being included in the referencing project on rename when it wasnt included earlier

Fixes #28307
This commit is contained in:
Sheetal Nandi
2018-11-07 10:13:55 -08:00
parent 16ea9af36e
commit ab4be8da42
3 changed files with 140 additions and 73 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ namespace ts.sourcemaps {
function getSourceFileLike(fileName: string, location: string): SourceFileLike | undefined {
// Lookup file in program, if provided
const path = toPath(fileName, location, host.getCanonicalFileName);
const file = program && program.getSourceFile(path);
const file = program && program.getSourceFileByPath(path);
// 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)