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

Commit

Permalink
gopls only supports versions > 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed May 24, 2019
1 parent 11c2113 commit 9655d52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ active development for it anymore and because it doesn't support Go modules, we

- If you are using the language server from Sourcegraph, you can continue to use it as long as you are not using Go modules.
- Since the language server from Google provides much better support for Go modules, you will be prompted about it when the extension detects that you are working on a project that uses Go modules.
- If you have never used language server before, and now opt to use it, you will be prompted to install and use the language server from Google.
- If you have never used language server before, and now opt to use it, you will be prompted to install and use the language server from Google as long as you are using a Go version > 1.10

> Note: The language server from Google supports Go version > 1.10 only
#### Settings to control the use of the Go language server

Expand Down
4 changes: 2 additions & 2 deletions src/goInstallTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function getTools(goVersion: SemVersion): string[] {
tools.push(goConfig['lintTool']);
}

if (goConfig['useLanguageServer']) {
if (goConfig['useLanguageServer'] && (goVersion.major > 1 || (goVersion.major === 1 && goVersion.minor > 10))) {
tools.push('gopls');
}

Expand Down Expand Up @@ -478,7 +478,7 @@ export function offerToInstallTools() {
});

const usingSourceGraph = getToolFromToolPath(getLanguageServerToolPath()) === 'go-langserver';
if (usingSourceGraph) {
if (usingSourceGraph && (goVersion.major > 1 || (goVersion.major === 1 && goVersion.minor > 10))) {
const promptMsg = 'The language server from Sourcegraph is no longer under active development and it does not support Go modules as well. Please install and use the language server from Google or disable the use of language servers altogether.';
const disableLabel = 'Disable language server';
const installLabel = 'Install';
Expand Down

0 comments on commit 9655d52

Please sign in to comment.