Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/server/scriptInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ namespace ts.server {

/*@internal*/
export function isDynamicFileName(fileName: NormalizedPath) {
return fileName[0] === "^" || getBaseFileName(fileName)[0] === "^";
return fileName[0] === "^";
}

/*@internal*/
Expand Down
18 changes: 18 additions & 0 deletions src/testRunner/unittests/tsserver/configuredProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,24 @@ declare var console: {
]
});
});

it("when file name starts with ^", () => {
const file: File = {
path: `${tscWatch.projectRoot}/file.ts`,
content: "const x = 10;"
};
const app: File = {
path: `${tscWatch.projectRoot}/^app.ts`,
content: "const y = 10;"
};
const tsconfig: File = {
path: `${tscWatch.projectRoot}/tsconfig.json`,
content: "{}"
};
const host = createServerHost([file, app, tsconfig, libFile]);
const service = createProjectService(host);
service.openClientFile(file.path);
});
});

describe("unittests:: tsserver:: ConfiguredProjects:: non-existing directories listed in config file input array", () => {
Expand Down
21 changes: 21 additions & 0 deletions src/testRunner/unittests/tsserver/externalProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,27 @@ namespace ts.projectSystem {
projectService.applyChangesInOpenFiles(arrayIterator(externalFiles));
});

it("when file name starts with ^", () => {
const file: File = {
path: `${tscWatch.projectRoot}/file.ts`,
content: "const x = 10;"
};
const app: File = {
path: `${tscWatch.projectRoot}/^app.ts`,
content: "const y = 10;"
};
const host = createServerHost([file, app, libFile]);
const service = createProjectService(host);
service.openExternalProjects([{
projectFileName: `${tscWatch.projectRoot}/myproject.njsproj`,
rootFiles: [
toExternalFile(file.path),
toExternalFile(app.path)
],
options: { },
}]);
});

it("external project that included config files", () => {
const file1 = {
path: "/a/b/f1.ts",
Expand Down