Hyang-Ah Hana Kim submitted this change.
src/language/goLanguageServer: do not require gopls when language server is disabled
This fixes a bug that made the extension to look up the path to the gopls
binary when go.useLanguageServer is false. During the lookup, if the gopls wasn't
available, getLanguageServerToolPath eventually triggerred the missing tool prompt
and that was not appropriate. Return from buildLanguageServerConfig early
if we don't need the language server.
Updates golang/vscode-go#2300
Change-Id: I7572244350f953c8ce874086f4f5cbb45a7301af
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/414456
Reviewed-by: Jamal Carvalho <ja...@golang.org>
Reviewed-by: Suzy Mueller <suz...@golang.org>
Run-TryBot: Hyang-Ah Hana Kim <hya...@gmail.com>
TryBot-Result: kokoro <noreply...@google.com>
---
M src/language/goLanguageServer.ts
1 file changed, 28 insertions(+), 4 deletions(-)
diff --git a/src/language/goLanguageServer.ts b/src/language/goLanguageServer.ts
index 83bee23..8561b25 100644
--- a/src/language/goLanguageServer.ts
+++ b/src/language/goLanguageServer.ts
@@ -798,6 +798,12 @@
env: toolExecutionEnvironment(),
checkForUpdates: getCheckForToolsUpdatesConfig(goConfig)
};
+ // user has opted out of using the language server.
+ if (!cfg.enabled) {
+ return cfg;
+ }
+
+ // locate the configured language server tool.
const languageServerPath = getLanguageServerToolPath();
if (!languageServerPath) {
// Assume the getLanguageServerToolPath will show the relevant
@@ -808,10 +814,6 @@
cfg.path = languageServerPath;
cfg.serverName = getToolFromToolPath(cfg.path) ?? '';
- if (!cfg.enabled) {
- return cfg;
- }
-
// Get the mtime of the language server binary so that we always pick up
// the right version.
const stats = fs.statSync(languageServerPath);
To view, visit change 414456. To unsubscribe, or for help writing mail filters, visit settings.
[release] src/language/goLanguageServer: do not require gopls when language server is disabled
This fixes a bug that made the extension to look up the path to the gopls
binary when go.useLanguageServer is false. During the lookup, if the gopls wasn't
available, getLanguageServerToolPath eventually triggerred the missing tool prompt
and that was not appropriate. Return from buildLanguageServerConfig early
if we don't need the language server.
Updates golang/vscode-go#2300
Change-Id: I7572244350f953c8ce874086f4f5cbb45a7301af
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/414456
Reviewed-by: Jamal Carvalho <ja...@golang.org>
Reviewed-by: Suzy Mueller <suz...@golang.org>
Run-TryBot: Hyang-Ah Hana Kim <hya...@gmail.com>
TryBot-Result: kokoro <noreply...@google.com>
(cherry picked from commit 4dd972eb0de8849c3207c3bf981bcad7471e9f9c)
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/414459
---
M src/language/goLanguageServer.ts
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/src/language/goLanguageServer.ts b/src/language/goLanguageServer.ts
index 4ca8354..28fd553 100644
--- a/src/language/goLanguageServer.ts
+++ b/src/language/goLanguageServer.ts
@@ -783,6 +783,12 @@
env: toolExecutionEnvironment(),
checkForUpdates: getCheckForToolsUpdatesConfig(goConfig)
};
+ // user has opted out of using the language server.
+ if (!cfg.enabled) {
+ return cfg;
+ }
+
+ // locate the configured language server tool.
const languageServerPath = getLanguageServerToolPath();
if (!languageServerPath) {
// Assume the getLanguageServerToolPath will show the relevant
@@ -793,10 +799,6 @@
cfg.path = languageServerPath;
cfg.serverName = getToolFromToolPath(cfg.path) ?? '';
- if (!cfg.enabled) {
- return cfg;
- }
-
// Get the mtime of the language server binary so that we always pick up
// the right version.
const stats = fs.statSync(languageServerPath);
To view, visit change 414459. To unsubscribe, or for help writing mail filters, visit settings.