mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Handle untitled files from vscode which are of format: untitled:^Untitled-1 (#36240)
* Test for #36200 * Handle dynamic files by vscode Fixes #36200
This commit is contained in:
@@ -1304,7 +1304,7 @@ namespace ts.server {
|
||||
// Closing file should trigger re-reading the file content from disk. This is
|
||||
// because the user may chose to discard the buffer content before saving
|
||||
// to the disk, and the server's version of the file can be out of sync.
|
||||
const fileExists = this.host.fileExists(info.fileName);
|
||||
const fileExists = info.isDynamic ? false : this.host.fileExists(info.fileName);
|
||||
info.close(fileExists);
|
||||
this.stopWatchingConfigFilesForClosedScriptInfo(info);
|
||||
|
||||
|
||||
@@ -272,7 +272,8 @@ namespace ts.server {
|
||||
|
||||
/*@internal*/
|
||||
export function isDynamicFileName(fileName: NormalizedPath) {
|
||||
return fileName[0] === "^";
|
||||
return fileName[0] === "^" ||
|
||||
(stringContains(fileName, ":^") && !stringContains(fileName, directorySeparator));
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
|
||||
Reference in New Issue
Block a user