mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Remove the check that if base file name starts with ^ is dynamic file name since those files can exist (#36109)
Fixes #35734
This commit is contained in:
parent
13cddae3f7
commit
00b21efcb0
@ -272,7 +272,7 @@ namespace ts.server {
|
||||
|
||||
/*@internal*/
|
||||
export function isDynamicFileName(fileName: NormalizedPath) {
|
||||
return fileName[0] === "^" || getBaseFileName(fileName)[0] === "^";
|
||||
return fileName[0] === "^";
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
|
||||
@ -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", () => {
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user