vscode-go: update @types/vscode and engines.vscode
For golang/vscode-go#2225.
Change-Id: I03af4d8f45c5f013f2492903c772e89fa578a83d
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/406305
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
diff --git a/package-lock.json b/package-lock.json
index b1fcfbb..4a37ffe 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -33,7 +33,7 @@
"@types/node": "13.13.46",
"@types/semver": "7.3.4",
"@types/sinon": "9.0.11",
- "@types/vscode": "1.59.0",
+ "@types/vscode": "1.67.0",
"@vscode/test-electron": "2.0.2",
"adm-zip": "0.4.16",
"esbuild": "0.12.21",
@@ -49,7 +49,7 @@
"yarn": "1.22.10"
},
"engines": {
- "vscode": "^1.59.0"
+ "vscode": "^1.67.0"
}
},
"node_modules/@babel/code-frame": {
@@ -352,9 +352,9 @@
"dev": true
},
"node_modules/@types/vscode": {
- "version": "1.59.0",
- "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.59.0.tgz",
- "integrity": "sha512-Zg38rusx2nU6gy6QdF7v4iqgxNfxzlBlDhrRCjOiPQp+sfaNrp3f9J6OHIhpGNN1oOAca4+9Hq0+8u3jwzPMlQ==",
+ "version": "1.67.0",
+ "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.67.0.tgz",
+ "integrity": "sha512-GH8BDf8cw9AC9080uneJfulhSa7KHSMI2s/CyKePXoGNos9J486w2V4YKoeNUqIEkW4hKoEAWp6/cXTwyGj47g==",
"dev": true
},
"node_modules/@typescript-eslint/eslint-plugin": {
@@ -5513,6 +5513,20 @@
"vscode": "^1.52.0"
}
},
+ "node_modules/vscode-languageclient/node_modules/semver": {
+ "version": "7.3.7",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
+ "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
+ "dependencies": {
+ "lru-cache": "^6.0.0"
+ },
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/vscode-languageserver-protocol": {
"version": "3.16.0",
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz",
@@ -6085,9 +6099,9 @@
"dev": true
},
"@types/vscode": {
- "version": "1.59.0",
- "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.59.0.tgz",
- "integrity": "sha512-Zg38rusx2nU6gy6QdF7v4iqgxNfxzlBlDhrRCjOiPQp+sfaNrp3f9J6OHIhpGNN1oOAca4+9Hq0+8u3jwzPMlQ==",
+ "version": "1.67.0",
+ "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.67.0.tgz",
+ "integrity": "sha512-GH8BDf8cw9AC9080uneJfulhSa7KHSMI2s/CyKePXoGNos9J486w2V4YKoeNUqIEkW4hKoEAWp6/cXTwyGj47g==",
"dev": true
},
"@typescript-eslint/eslint-plugin": {
@@ -9905,6 +9919,16 @@
"minimatch": "^3.0.4",
"semver": "^7.3.4",
"vscode-languageserver-protocol": "3.16.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "7.3.7",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
+ "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ }
}
},
"vscode-languageserver-protocol": {
diff --git a/package.json b/package.json
index 94e40f7..0e15131 100644
--- a/package.json
+++ b/package.json
@@ -73,7 +73,7 @@
"@types/node": "13.13.46",
"@types/semver": "7.3.4",
"@types/sinon": "9.0.11",
- "@types/vscode": "1.59.0",
+ "@types/vscode": "1.67.0",
"@vscode/test-electron": "2.0.2",
"adm-zip": "0.4.16",
"esbuild": "0.12.21",
@@ -89,7 +89,7 @@
"yarn": "1.22.10"
},
"engines": {
- "vscode": "^1.59.0"
+ "vscode": "^1.67.0"
},
"activationEvents": [
"onLanguage:go",
diff --git a/src/goDeveloperSurvey.ts b/src/goDeveloperSurvey.ts
index 106bfb0..ef61afb 100644
--- a/src/goDeveloperSurvey.ts
+++ b/src/goDeveloperSurvey.ts
@@ -123,7 +123,7 @@
}
export async function promptForDeveloperSurvey(cfg: DeveloperSurveyConfig, now: Date): Promise<DeveloperSurveyConfig> {
- let selected = await vscode.window.showInformationMessage(
+ const selected = await vscode.window.showInformationMessage(
// TODO(rstambler): Figure out how to phrase this.
`Looks like you are coding in Go! Would you like to help ensure that Go is meeting your needs
by participating in this 10-minute survey before ${endDate.toDateString()}?`,
@@ -153,10 +153,10 @@
vscode.window.showInformationMessage("No problem! We'll ask you again another time.");
break;
- case 'Never':
+ case 'Never': {
cfg.prompt = false;
- selected = await vscode.window.showInformationMessage(
+ const selected = await vscode.window.showInformationMessage(
`No problem! We won't ask again.
If you'd like to opt-out of all survey prompts, you can set 'go.survey.prompt' to false.`,
'Open Settings'
@@ -169,6 +169,7 @@
break;
}
break;
+ }
default:
// If the user closes the prompt without making a selection, treat it
// like a "Not now" response.
diff --git a/src/goSurvey.ts b/src/goSurvey.ts
index 35559a8..a06f1d4 100644
--- a/src/goSurvey.ts
+++ b/src/goSurvey.ts
@@ -152,7 +152,7 @@
cfg: GoplsSurveyConfig = {},
now: Date
): Promise<GoplsSurveyConfig> {
- let selected = await vscode.window.showInformationMessage(
+ const selected = await vscode.window.showInformationMessage(
`Looks like you are using the Go extension for VS Code.
Could you help us improve this extension by filling out a 1-2 minute survey about your experience with it?`,
'Yes',
@@ -182,10 +182,10 @@
vscode.window.showInformationMessage("No problem! We'll ask you again another time.");
break;
- case 'Never':
+ case 'Never': {
cfg.prompt = false;
- selected = await vscode.window.showInformationMessage(
+ const selected = await vscode.window.showInformationMessage(
`No problem! We won't ask again.
To opt-out of all survey prompts, please disable the 'Go > Survey: Prompt' setting.`,
'Open Settings'
@@ -198,6 +198,7 @@
break;
}
break;
+ }
default:
// If the user closes the prompt without making a selection, treat it
// like a "Not now" response.
diff --git a/src/goTest/run.ts b/src/goTest/run.ts
index a323066..4147da9 100644
--- a/src/goTest/run.ts
+++ b/src/goTest/run.ts
@@ -71,6 +71,7 @@
show(...args: unknown[]) {}
hide() {}
dispose() {}
+ replace() {}
}
export class GoTestRunner {
@@ -400,7 +401,7 @@
async collectTests(
item: TestItem,
explicitlyIncluded: boolean,
- excluded: TestItem[],
+ excluded: readonly TestItem[],
functions: Map<TestItem, CollectedTest[]>,
files: Set<TestItem>
) {
diff --git a/test/gopls/extension.test.ts b/test/gopls/extension.test.ts
index 0d89e18..c08f914 100644
--- a/test/gopls/extension.test.ts
+++ b/test/gopls/extension.test.ts
@@ -25,6 +25,7 @@
public show = sinon.fake(); // no-empty
public hide = sinon.fake(); // no-empty
public dispose = sinon.fake(); // no-empty
+ public replace = sinon.fake(); // no-empty
private buf = [] as string[];
diff --git a/test/integration/goTest.explore.test.ts b/test/integration/goTest.explore.test.ts
index 2f5848b..0beda07 100644
--- a/test/integration/goTest.explore.test.ts
+++ b/test/integration/goTest.explore.test.ts
@@ -186,7 +186,8 @@
doc.contents = contents;
await expl._didChange({
document: doc,
- contentChanges: []
+ contentChanges: [],
+ reason: undefined
});
}
@@ -333,7 +334,11 @@
expectedTests
);
- await explorer.runner.run({ include: [tests[0]] });
+ await explorer.runner.run({
+ include: [tests[0]],
+ exclude: undefined,
+ profile: undefined
+ });
assert.strictEqual(runStub.callCount, 1, 'Expected goTest to be called once');
assert.deepStrictEqual(runStub.lastCall.args[0].functions, ['TestFoo']);
});
@@ -350,7 +355,11 @@
expectedTests
);
- await explorer.runner.run({ include: [tests[0]] });
+ await explorer.runner.run({
+ include: [tests[0]],
+ exclude: undefined,
+ profile: undefined
+ });
assert.strictEqual(runStub.callCount, 2, 'Expected goTest to be called twice');
assert.deepStrictEqual(runStub.firstCall.args[0].functions, ['TestFoo']);
assert.deepStrictEqual(runStub.secondCall.args[0].functions, ['BenchmarkBar']);
@@ -393,7 +402,11 @@
.filter((x) => GoTest.parseId(x.id).name)[0];
assert(test, 'Could not find test');
- await explorer.runner.run({ include: [test] });
+ await explorer.runner.run({
+ include: [test],
+ exclude: undefined,
+ profile: undefined
+ });
assert.strictEqual(runStub.callCount, 1, 'Expected goTest to be called once');
const subTest = test.children.get('file:///src/proj/main_test.go?test#TestFoo%2FBar');
@@ -413,7 +426,11 @@
.filter((x) => GoTest.parseId(x.id).name)[0];
assert(test, 'Could not find test');
- await explorer.runner.run({ include: [test] });
+ await explorer.runner.run({
+ include: [test],
+ exclude: undefined,
+ profile: undefined
+ });
assert.strictEqual(runStub.callCount, 1, 'Expected goTest to be called once');
const subTest = test.children.get('file:///src/proj/main_test.go?test#TestFoo%2FBar');
diff --git a/test/integration/goTest.run.test.ts b/test/integration/goTest.run.test.ts
index 50ffc7b..2bce593 100644
--- a/test/integration/goTest.run.test.ts
+++ b/test/integration/goTest.run.test.ts
@@ -52,7 +52,15 @@
assert(test, 'No tests found');
assert(
- await testExplorer.runner.run({ include: [test] }, undefined, { kind: 'cpu' }),
+ await testExplorer.runner.run(
+ {
+ include: [test],
+ exclude: undefined,
+ profile: undefined
+ },
+ undefined,
+ { kind: 'cpu' }
+ ),
'Failed to execute `go test`'
);
assert.strictEqual(stub.callCount, 1, 'expected one call to goTest');
@@ -64,7 +72,14 @@
const tests = Array.from(testExplorer.resolver.allItems).filter((x) => GoTest.parseId(x.id).name);
assert(tests, 'No tests found');
- assert(await testExplorer.runner.run({ include: tests }), 'Failed to execute `go test`');
+ assert(
+ await testExplorer.runner.run({
+ include: tests,
+ exclude: undefined,
+ profile: undefined
+ }),
+ 'Failed to execute `go test`'
+ );
assert.strictEqual(stub.callCount, 1, 'expected one call to goTest');
assert.deepStrictEqual(
stub.lastCall.args[0].functions,
@@ -79,7 +94,15 @@
console.log(`running ${tests.length} tests`);
assert(
- await testExplorer.runner.run({ include: tests }, undefined, { kind: 'cpu' }),
+ await testExplorer.runner.run(
+ {
+ include: tests,
+ exclude: undefined,
+ profile: undefined
+ },
+ undefined,
+ { kind: 'cpu' }
+ ),
'Failed to execute `go test`'
);
console.log('verify we got expected calls');
@@ -129,7 +152,14 @@
// Run TestMain
console.log('Run TestMain');
- assert(await testExplorer.runner.run({ include: [tMain] }), 'Failed to execute `go test`');
+ assert(
+ await testExplorer.runner.run({
+ include: [tMain],
+ exclude: undefined,
+ profile: undefined
+ }),
+ 'Failed to execute `go test`'
+ );
assert.strictEqual(spy.callCount, 1, 'expected one call to goTest');
// Verify TestMain was run
@@ -152,7 +182,14 @@
// Run subtest by itself
console.log('Run subtest by itself');
- assert(await testExplorer.runner.run({ include: [tSub] }), 'Failed to execute `go test`');
+ assert(
+ await testExplorer.runner.run({
+ include: [tSub],
+ exclude: undefined,
+ profile: undefined
+ }),
+ 'Failed to execute `go test`'
+ );
assert.strictEqual(spy.callCount, 1, 'expected one call to goTest');
// Verify TestMain/Sub was run
@@ -168,7 +205,14 @@
// Attempt to run subtest and other test - should not work
console.log('Attempt to run subtest and other test');
- assert(await testExplorer.runner.run({ include: [tSub, tOther] }), 'Failed to execute `go test`');
+ assert(
+ await testExplorer.runner.run({
+ include: [tSub, tOther],
+ exclude: undefined,
+ profile: undefined
+ }),
+ 'Failed to execute `go test`'
+ );
assert.strictEqual(spy.callCount, 0, 'expected no calls to goTest');
}).timeout(4000);
});
diff --git a/test/mocks/MockTest.ts b/test/mocks/MockTest.ts
index 599dd40..86c146e 100644
--- a/test/mocks/MockTest.ts
+++ b/test/mocks/MockTest.ts
@@ -20,6 +20,7 @@
TestRunProfile,
TestRunProfileKind,
TestRunRequest,
+ TestTag,
TextDocument,
TextLine,
Uri,
@@ -77,13 +78,15 @@
this.idNum = MockTestItem.idNum;
MockTestItem.idNum++;
}
+ tags: readonly TestTag[] = [];
+ sortText?: string | undefined;
parent: TestItem | undefined;
canResolveChildren = false;
busy = false;
description?: string;
- range?: Range;
- error?: string | MarkdownString;
+ range: Range | undefined;
+ error: string | MarkdownString | undefined;
runnable = false;
debuggable = false;
@@ -105,8 +108,9 @@
public runHandler: TestRunHandler,
public isDefault: boolean
) {}
+ tag: TestTag | undefined;
- configureHandler?: () => void;
+ configureHandler(): void {}
dispose(): void {}
}
@@ -134,6 +138,7 @@
items = new MockTestCollection(this);
resolveHandler?: (item: TestItem | undefined) => void | Thenable<void>;
+ refreshHandler: ((token: CancellationToken) => void | Thenable<void>) | undefined;
createTestRun(request: TestRunRequest, name?: string, persist?: boolean): TestRun {
return new MockTestRun();