mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 05:41:22 -06:00
Simplify test and add explanatory assertion
This commit is contained in:
parent
90e11f0797
commit
b9ea3471a4
@ -1185,13 +1185,9 @@ namespace ts.projectSystem {
|
||||
});
|
||||
|
||||
it("external project for dynamic file", () => {
|
||||
const file1 = {
|
||||
path: "/a/b/f1.ts",
|
||||
content: "let x =1;"
|
||||
};
|
||||
const externalProjectName = "^ScriptDocument1 file1.ts";
|
||||
const externalFiles = toExternalFiles(["^ScriptDocument1 file1.ts"]);
|
||||
const host = createServerHost([file1]);
|
||||
const host = createServerHost([]);
|
||||
const projectService = createProjectService(host);
|
||||
projectService.openExternalProject({
|
||||
rootFiles: externalFiles,
|
||||
|
||||
@ -1779,6 +1779,7 @@ namespace ts.server {
|
||||
const isDynamic = isDynamicFileName(fileName);
|
||||
Debug.assert(isRootedDiskPath(fileName) || isDynamic || openedByClient, "Script info with non-dynamic relative file name can only be open script info");
|
||||
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");
|
||||
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.");
|
||||
// If the file is not opened by client and the file doesnot exist on the disk, return
|
||||
if (!openedByClient && !isDynamic && !(hostToQueryFileExistsOn || this.host).fileExists(fileName)) {
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user