@@ -10481,20 +10481,28 @@ declare class TestLib {
10481
10481
TestFSWithWatch.getTsBuildProjectFile(project, "index.ts"),
10482
10482
];
10483
10483
}
10484
- it("does not error on container only project", () => {
10485
- const project = "container";
10486
- const containerLib = getProjectFiles("container/lib");
10487
- const containerExec = getProjectFiles("container/exec");
10488
- const containerCompositeExec = getProjectFiles("container/compositeExec");
10489
- const containerConfig = TestFSWithWatch.getTsBuildProjectFile(project, "tsconfig.json");
10490
- const files = [libFile, ...containerLib, ...containerExec, ...containerCompositeExec, containerConfig];
10484
+
10485
+ const project = "container";
10486
+ const containerLib = getProjectFiles("container/lib");
10487
+ const containerExec = getProjectFiles("container/exec");
10488
+ const containerCompositeExec = getProjectFiles("container/compositeExec");
10489
+ const containerConfig = TestFSWithWatch.getTsBuildProjectFile(project, "tsconfig.json");
10490
+ const files = [libFile, ...containerLib, ...containerExec, ...containerCompositeExec, containerConfig];
10491
+
10492
+ function createHost() {
10491
10493
const host = createServerHost(files);
10492
10494
10493
10495
// ts build should succeed
10494
10496
const solutionBuilder = tscWatch.createSolutionBuilder(host, [containerConfig.path], {});
10495
10497
solutionBuilder.buildAllProjects();
10496
10498
assert.equal(host.getOutput().length, 0);
10497
10499
10500
+ return host;
10501
+ }
10502
+
10503
+ it("does not error on container only project", () => {
10504
+ const host = createHost();
10505
+
10498
10506
// Open external project for the folder
10499
10507
const session = createSession(host);
10500
10508
const service = session.getProjectService();
@@ -10521,6 +10529,30 @@ declare class TestLib {
10521
10529
assert.deepEqual(semanticDiagnostics, []);
10522
10530
});
10523
10531
});
10532
+
10533
+ it("can successfully find references with --out options", () => {
10534
+ const host = createHost();
10535
+ const session = createSession(host);
10536
+ openFilesForSession([containerCompositeExec[1]], session);
10537
+ const service = session.getProjectService();
10538
+ checkNumberOfProjects(service, { configuredProjects: 1 });
10539
+ const locationOfMyConst = protocolLocationFromSubstring(containerCompositeExec[1].content, "myConst");
10540
+ const response = session.executeCommandSeq<protocol.RenameRequest>({
10541
+ command: protocol.CommandTypes.Rename,
10542
+ arguments: {
10543
+ file: containerCompositeExec[1].path,
10544
+ ...locationOfMyConst
10545
+ }
10546
+ }).response as protocol.RenameResponseBody;
10547
+
10548
+
10549
+ const myConstLen = "myConst".length;
10550
+ const locationOfMyConstInLib = protocolLocationFromSubstring(containerLib[1].content, "myConst");
10551
+ assert.deepEqual(response.locs, [
10552
+ { file: containerCompositeExec[1].path, locs: [{ start: locationOfMyConst, end: { line: locationOfMyConst.line, offset: locationOfMyConst.offset + myConstLen } }] },
10553
+ { file: containerLib[1].path, locs: [{ start: locationOfMyConstInLib, end: { line: locationOfMyConstInLib.line, offset: locationOfMyConstInLib.offset + myConstLen } }] }
10554
+ ]);
10555
+ });
10524
10556
});
10525
10557
10526
10558
describe("tsserverProjectSystem duplicate packages", () => {
0 commit comments