Skip to content

Commit 2fb11d8

Browse files
committed
Test transitive references in folders side by side so that later we can add tsserver tests as well
1 parent 3e67cf4 commit 2fb11d8

File tree

3 files changed

+239
-166
lines changed

3 files changed

+239
-166
lines changed

src/compiler/watch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ namespace ts {
780780
(hostSourceFileInfo as FilePresentOnHost).fileWatcher.close();
781781
}
782782
sourceFilesCache.delete(oldSourceFile.resolvedPath);
783-
if (oldSourceFile.resolvedPath === oldSourceFile.path || !hasSourceFileByPath) {
783+
if (!hasSourceFileByPath) {
784784
resolutionCache.removeResolutionsOfFile(oldSourceFile.path);
785785
}
786786
}

src/server/project.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,8 @@ namespace ts.server {
925925
const newFile = this.program.getSourceFileByPath(f.resolvedPath);
926926
if (!newFile || (f.resolvedPath === f.path && newFile.resolvedPath !== f.path)) {
927927
// new program does not contain this file - detach it from the project
928-
// - remove resolutions only if this is undirected file or doesnt have source file with the path in new program
929-
this.detachScriptInfoFromProject(f.fileName, f.path !== f.resolvedPath && !!this.program.getSourceFileByPath(f.path));
928+
// - remove resolutions only if the new program doesnt contain source file by the path (not resolvedPath since path is used for resolution)
929+
this.detachScriptInfoFromProject(f.fileName, !!this.program.getSourceFileByPath(f.path));
930930
}
931931
}
932932

0 commit comments

Comments
 (0)