Skip to content

Commit 5212b15

Browse files
committed
extension/src/goTools.ts: remove unused fields from Tool.
`close` was used to shut down old tools like `gocode`. That is no longer used. Delete it. `maximumGoVersion` was used when the extension had to choose different tools depending on the go version. We no longer use it. Delete it. Change-Id: Ie4963c084f78b5d3c853fcf6a2828af2aacb318f Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/618355 Commit-Queue: Hyang-Ah Hana Kim <hyangah@gmail.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Hongxiang Jiang <hxjiang@golang.org>
1 parent bd65f44 commit 5212b15

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

extension/src/goInstallTools.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,6 @@ async function installToolWithGo(
289289
goVersion: GoVersion, // go version to be used for installation.
290290
envForTools: NodeJS.Dict<string>
291291
): Promise<string | undefined> {
292-
// Some tools may have to be closed before we reinstall them.
293-
if (tool.close) {
294-
const reason = await tool.close(envForTools);
295-
if (reason) {
296-
return reason;
297-
}
298-
}
299-
300292
const env = Object.assign({}, envForTools);
301293

302294
let version: semver.SemVer | string | undefined | null = tool.version;
@@ -365,14 +357,6 @@ export async function promptForMissingTool(toolName: string) {
365357
);
366358
return;
367359
}
368-
if (tool.maximumGoVersion && goVersion.gt(tool.maximumGoVersion.format())) {
369-
vscode.window.showInformationMessage(
370-
`You are using go${goVersion.format()}, but ${
371-
tool.name
372-
} only supports go${tool.maximumGoVersion.format()} and below.`
373-
);
374-
return;
375-
}
376360

377361
const installOptions = ['Install'];
378362
let missing = await getMissingTools();

extension/src/goTools.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,9 @@ export interface Tool {
3737
latestPrereleaseVersion?: semver.SemVer | null;
3838
latestPrereleaseVersionTimestamp?: moment.Moment;
3939

40-
// minimumGoVersion and maximumGoVersion set the range for the versions of
41-
// Go with which this tool can be used.
40+
// minimumGoVersion sets the minimum required version of Go
41+
// for the tool.
4242
minimumGoVersion?: semver.SemVer | null;
43-
maximumGoVersion?: semver.SemVer | null;
44-
45-
// close performs any shutdown tasks that a tool must execute before a new
46-
// version is installed. It returns a string containing an error message on
47-
// failure.
48-
close?: (env: NodeJS.Dict<string>) => Promise<string>;
4943
}
5044

5145
/**

0 commit comments

Comments
 (0)