Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b9ea347

Browse filesBrowse files
author
Benjamin Lichtman
committed
Simplify test and add explanatory assertion
1 parent 90e11f0 commit b9ea347
Copy full SHA for b9ea347

2 files changed

+2-5Lines changed: 2 additions & 5 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/harness/unittests/tsserverProjectSystem.ts‎

Copy file name to clipboardExpand all lines: src/harness/unittests/tsserverProjectSystem.ts
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,13 +1185,9 @@ namespace ts.projectSystem {
11851185
});
11861186

11871187
it("external project for dynamic file", () => {
1188-
const file1 = {
1189-
path: "/a/b/f1.ts",
1190-
content: "let x =1;"
1191-
};
11921188
const externalProjectName = "^ScriptDocument1 file1.ts";
11931189
const externalFiles = toExternalFiles(["^ScriptDocument1 file1.ts"]);
1194-
const host = createServerHost([file1]);
1190+
const host = createServerHost([]);
11951191
const projectService = createProjectService(host);
11961192
projectService.openExternalProject({
11971193
rootFiles: externalFiles,
Collapse file

‎src/server/editorServices.ts‎

Copy file name to clipboardExpand all lines: src/server/editorServices.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,7 @@ namespace ts.server {
17791779
const isDynamic = isDynamicFileName(fileName);
17801780
Debug.assert(isRootedDiskPath(fileName) || isDynamic || openedByClient, "Script info with non-dynamic relative file name can only be open script info");
17811781
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");
1782+
Debug.assert(!isDynamic || this.currentDirectory === currentDirectory, "Dynamic files must always have current directory context since containing external project name will always match the script info name.");
17821783
// If the file is not opened by client and the file doesnot exist on the disk, return
17831784
if (!openedByClient && !isDynamic && !(hostToQueryFileExistsOn || this.host).fileExists(fileName)) {
17841785
return;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.