@@ -9555,6 +9555,65 @@ export function Test2() {
9555
9555
});
9556
9556
});
9557
9557
9558
+ describe("tsserverProjectSystem typeReferenceDirectives", () => {
9559
+ it("when typeReferenceDirective contains UpperCasePackage", () => {
9560
+ const projectLocation = "/user/username/projects/myproject";
9561
+ const libProjectLocation = `${projectLocation}/lib`;
9562
+ const typeLib: File = {
9563
+ path: `${libProjectLocation}/@types/UpperCasePackage/index.d.ts`,
9564
+ content: `declare class BrokenTest {
9565
+ constructor(name: string, width: number, height: number, onSelect: Function);
9566
+ Name: string;
9567
+ SelectedFile: string;
9568
+ }`
9569
+ };
9570
+ const appLib: File = {
9571
+ path: `${libProjectLocation}/@app/lib/index.d.ts`,
9572
+ content: `/// <reference types="UpperCasePackage" />
9573
+ declare class TestLib {
9574
+ issue: BrokenTest;
9575
+ constructor();
9576
+ test(): void;
9577
+ }`
9578
+ };
9579
+ const testProjectLocation = `${projectLocation}/test`;
9580
+ const testFile: File = {
9581
+ path: `${testProjectLocation}/test.ts`,
9582
+ content: `class TestClass1 {
9583
+
9584
+ constructor() {
9585
+ var l = new TestLib();
9586
+
9587
+ }
9588
+
9589
+ public test2() {
9590
+ var x = new BrokenTest('',0,0,null);
9591
+
9592
+ }
9593
+ }`
9594
+ };
9595
+ const testConfig: File = {
9596
+ path: `${testProjectLocation}/tsconfig.json`,
9597
+ content: JSON.stringify({
9598
+ compilerOptions: {
9599
+ module: "amd",
9600
+ typeRoots: ["../lib/@types", "../lib/@app"]
9601
+ }
9602
+ })
9603
+ };
9604
+
9605
+ const files = [typeLib, appLib, testFile, testConfig, libFile];
9606
+ const host = createServerHost(files);
9607
+ const service = createProjectService(host);
9608
+ service.openClientFile(testFile.path);
9609
+ checkNumberOfProjects(service, { configuredProjects: 1 });
9610
+ const project = service.configuredProjects.get(testConfig.path)!;
9611
+ checkProjectActualFiles(project, files.map(f => f.path));
9612
+ host.writeFile(appLib.path, appLib.content.replace("test()", "test2()"));
9613
+ host.checkTimeoutQueueLengthAndRun(2);
9614
+ });
9615
+ });
9616
+
9558
9617
describe("tsserverProjectSystem project references", () => {
9559
9618
const aTs: File = {
9560
9619
path: "/a/a.ts",
0 commit comments