Skip to content

Commit 72fd9cb

Browse files
committed
Final cleanup
1 parent a90cc0e commit 72fd9cb

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

.vscode-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
const { defineConfig } = require("@vscode/test-cli");
1616
const path = require("path");
1717

18-
const isCIBuild = false; // process.env["CI"] === "1";
18+
const isCIBuild = process.env["CI"] === "1";
1919
const isFastTestRun = process.env["FAST_TEST_RUN"] === "1";
2020

2121
// "env" in launch.json doesn't seem to work with vscode-test

src/commands/build.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,25 @@ export async function debugBuildWithOptions(
7474
) {
7575
const current = ctx.currentFolder;
7676
if (!current) {
77-
console.log(" >>> debugBuildWithOptions: No current folder on WorkspaceContext");
77+
console.log("debugBuildWithOptions: No current folder on WorkspaceContext");
7878
return;
7979
}
8080

8181
const file = vscode.window.activeTextEditor?.document.fileName;
8282
if (!file) {
83-
console.log(" >>> debugBuildWithOptions: No active text editor");
83+
console.log("debugBuildWithOptions: No active text editor");
8484
return;
8585
}
8686

8787
const target = current.swiftPackage.getTarget(file);
8888
if (!target) {
89-
console.log(" >>> debugBuildWithOptions: No active target");
89+
console.log("debugBuildWithOptions: No active target");
9090
return;
9191
}
9292

9393
if (target.type !== "executable") {
9494
console.log(
95-
` >>> debugBuildWithOptions: Target is not an executable, instead is ${target.type}`
95+
`debugBuildWithOptions: Target is not an executable, instead is ${target.type}`
9696
);
9797
return;
9898
}

test/integration-tests/DiagnosticsManager.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -401,14 +401,12 @@ suite("DiagnosticsManager Test Suite", async function () {
401401
test("Parse partial line", async () => {
402402
const fixture = testSwiftTask("swift", ["build"], workspaceFolder, toolchain);
403403
await vscode.tasks.executeTask(fixture.task);
404-
const diagnosticsPromise = Promise.resolve(); // waitForDiagnostics([mainUri]);
405404
// Wait to spawn before writing
406405
fixture.process.write(`${mainUri.fsPath}:13:5: err`, "");
407406
fixture.process.write("or: Cannot find 'fo", "");
408407
fixture.process.write("o' in scope");
409408
fixture.process.close(1);
410409
await waitForNoRunningTasks();
411-
await diagnosticsPromise;
412410
// Should have parsed
413411
assertHasDiagnostic(mainUri, outputDiagnostic);
414412
});
@@ -417,15 +415,13 @@ suite("DiagnosticsManager Test Suite", async function () {
417415
test("Ignore duplicates", async () => {
418416
const fixture = testSwiftTask("swift", ["build"], workspaceFolder, toolchain);
419417
await vscode.tasks.executeTask(fixture.task);
420-
const diagnosticsPromise = Promise.resolve(); // waitForDiagnostics([mainUri]);
421418
// Wait to spawn before writing
422419
const output = `${mainUri.fsPath}:13:5: error: Cannot find 'foo' in scope`;
423420
fixture.process.write(output);
424421
fixture.process.write("some random output");
425422
fixture.process.write(output);
426423
fixture.process.close(1);
427424
await waitForNoRunningTasks();
428-
await diagnosticsPromise;
429425
const diagnostics = vscode.languages.getDiagnostics(mainUri);
430426
// Should only include one
431427
assert.equal(diagnostics.length, 1);
@@ -435,12 +431,10 @@ suite("DiagnosticsManager Test Suite", async function () {
435431
test("New set of swiftc diagnostics clear old list", async () => {
436432
let fixture = testSwiftTask("swift", ["build"], workspaceFolder, toolchain);
437433
await vscode.tasks.executeTask(fixture.task);
438-
let diagnosticsPromise = Promise.resolve(); // waitForDiagnostics([mainUri]);
439434
// Wait to spawn before writing
440435
fixture.process.write(`${mainUri.fsPath}:13:5: error: Cannot find 'foo' in scope`);
441436
fixture.process.close(1);
442437
await waitForNoRunningTasks();
443-
await diagnosticsPromise;
444438
let diagnostics = vscode.languages.getDiagnostics(mainUri);
445439
// Should only include one
446440
assert.equal(diagnostics.length, 1);
@@ -449,10 +443,8 @@ suite("DiagnosticsManager Test Suite", async function () {
449443
// Run again but no diagnostics returned
450444
fixture = testSwiftTask("swift", ["build"], workspaceFolder, toolchain);
451445
await vscode.tasks.executeTask(fixture.task);
452-
diagnosticsPromise = Promise.resolve(); // waitForDiagnostics([mainUri]);
453446
fixture.process.close(0);
454447
await waitForNoRunningTasks();
455-
await diagnosticsPromise;
456448
diagnostics = vscode.languages.getDiagnostics(mainUri);
457449
// Should have cleaned up
458450
assert.equal(diagnostics.length, 0);

test/integration-tests/WorkspaceContext.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ suite("WorkspaceContext Test Suite", () => {
7474
assert.strictEqual(
7575
addedCount,
7676
1,
77-
`Expected only one add folder operation, instead got folders: ${recordedFolders}`
77+
`Expected only one add folder operation, instead got folders: ${recordedFolders.map(folder => folder.folder?.name)}`
7878
);
7979
} finally {
8080
observer?.dispose();

0 commit comments

Comments
 (0)