Skip to content

Commit

Permalink
extension/src/goTools.ts: remove unused fields from Tool.
Browse files Browse the repository at this point in the history
`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>
  • Loading branch information
hyangah committed Oct 7, 2024
1 parent bd65f44 commit 5212b15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
16 changes: 0 additions & 16 deletions extension/src/goInstallTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,6 @@ async function installToolWithGo(
goVersion: GoVersion, // go version to be used for installation.
envForTools: NodeJS.Dict<string>
): Promise<string | undefined> {
// Some tools may have to be closed before we reinstall them.
if (tool.close) {
const reason = await tool.close(envForTools);
if (reason) {
return reason;
}
}

const env = Object.assign({}, envForTools);

let version: semver.SemVer | string | undefined | null = tool.version;
Expand Down Expand Up @@ -365,14 +357,6 @@ export async function promptForMissingTool(toolName: string) {
);
return;
}
if (tool.maximumGoVersion && goVersion.gt(tool.maximumGoVersion.format())) {
vscode.window.showInformationMessage(
`You are using go${goVersion.format()}, but ${
tool.name
} only supports go${tool.maximumGoVersion.format()} and below.`
);
return;
}

const installOptions = ['Install'];
let missing = await getMissingTools();
Expand Down
10 changes: 2 additions & 8 deletions extension/src/goTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,9 @@ export interface Tool {
latestPrereleaseVersion?: semver.SemVer | null;
latestPrereleaseVersionTimestamp?: moment.Moment;

// minimumGoVersion and maximumGoVersion set the range for the versions of
// Go with which this tool can be used.
// minimumGoVersion sets the minimum required version of Go
// for the tool.
minimumGoVersion?: semver.SemVer | null;
maximumGoVersion?: semver.SemVer | null;

// close performs any shutdown tasks that a tool must execute before a new
// version is installed. It returns a string containing an error message on
// failure.
close?: (env: NodeJS.Dict<string>) => Promise<string>;
}

/**
Expand Down

0 comments on commit 5212b15

Please sign in to comment.