Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

src/goLanguageServer: fix missing gopls detection logic #3197

Merged
merged 2 commits into from
Apr 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/goInstallTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,7 @@ function getMissingTools(goVersion: GoVersion): Promise<Tool[]> {
(tool) =>
new Promise<Tool>((resolve, reject) => {
const toolPath = getBinPath(tool.name);
fs.exists(toolPath, (exists) => {
resolve(exists ? null : tool);
});
resolve(path.isAbsolute(toolPath) ? null : tool);
})
)
).then((res) => {
Expand Down
3 changes: 2 additions & 1 deletion src/goLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,10 @@ Please install it and reload this VS Code window.`
if (alternateTools['go-langserver']) {
vscode.window.showErrorMessage(`Support for "go-langserver" has been deprecated.
The recommended language server is gopls. Delete the alternate tool setting for "go-langserver" to use gopls, or change "go-langserver" to "gopls" in your settings.json and reload the VS Code window.`);
return;
}
return;
}

// Prompt the user to install gopls.
promptForMissingTool('gopls');
}
Expand Down