mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-26 20:14:05 -05:00
Remove unnecessary assert (since we allow already open file to be opened again even through openFile command - partially) from updateOpen command (#37059)
Fixes #35034
This commit is contained in:
@@ -2414,7 +2414,7 @@ namespace ts.server {
|
||||
this.openFilesWithNonRootedDiskPath.set(this.toCanonicalFileName(fileName), info);
|
||||
}
|
||||
}
|
||||
if (openedByClient && !info.isScriptOpen()) {
|
||||
if (openedByClient) {
|
||||
// Opening closed script info
|
||||
// either it was created just now, or was part of projects but was closed
|
||||
this.stopWatchingScriptInfo(info);
|
||||
@@ -2423,9 +2423,6 @@ namespace ts.server {
|
||||
info.registerFileUpdate();
|
||||
}
|
||||
}
|
||||
else {
|
||||
Debug.assert(fileContent === undefined);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -3170,11 +3167,9 @@ namespace ts.server {
|
||||
const iterResult = openFiles.next();
|
||||
if (iterResult.done) break;
|
||||
const file = iterResult.value;
|
||||
const scriptInfo = this.getScriptInfo(file.fileName);
|
||||
Debug.assert(!scriptInfo || !scriptInfo.isScriptOpen(), "Script should not exist and not be open already");
|
||||
// Create script infos so we have the new content for all the open files before we do any updates to projects
|
||||
const info = this.getOrCreateOpenScriptInfo(
|
||||
scriptInfo ? scriptInfo.fileName : toNormalizedPath(file.fileName),
|
||||
toNormalizedPath(file.fileName),
|
||||
file.content,
|
||||
tryConvertScriptKindName(file.scriptKind!),
|
||||
file.hasMixedContent,
|
||||
|
||||
Reference in New Issue
Block a user