Skip to content

Commit d4dd930

Browse files
Allow dynamic files script info to be created when not opened by client
1 parent b15ecfc commit d4dd930

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/server/editorServices.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,9 +1776,9 @@ namespace ts.server {
17761776
const path = normalizedPathToPath(fileName, currentDirectory, this.toCanonicalFileName);
17771777
let info = this.getScriptInfoForPath(path);
17781778
if (!info) {
1779-
Debug.assert(isRootedDiskPath(fileName) || openedByClient, "Script info with relative file name can only be open script info");
1780-
Debug.assert(!isRootedDiskPath(fileName) || this.currentDirectory === currentDirectory || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(fileName)), "Open script files with non rooted disk path opened with current directory context cannot have same canonical names");
17811779
const isDynamic = isDynamicFileName(fileName);
1780+
Debug.assert(isRootedDiskPath(fileName) || isDynamic || openedByClient, "Script info with non-dynamic relative file name can only be open script info");
1781+
Debug.assert(!isRootedDiskPath(fileName) || this.currentDirectory === currentDirectory || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(fileName)), "Open script files with non rooted disk path opened with current directory context cannot have same canonical names");
17821782
// If the file is not opened by client and the file doesnot exist on the disk, return
17831783
if (!openedByClient && !isDynamic && !(hostToQueryFileExistsOn || this.host).fileExists(fileName)) {
17841784
return;

0 commit comments

Comments
 (0)