Skip to content

Commit b012df4

Browse files
committed
src/goInstallTools: show error if go.languageserver.restart fails
Instead of throwing errors and failing to resolve promise. Fixes #2356 Change-Id: Ie1bb270217ab12f95e640ccde2d80bfd0eb13292 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/418354 TryBot-Result: kokoro <[email protected]> Reviewed-by: Jamal Carvalho <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
1 parent c8598b1 commit b012df4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/goInstallTools.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,11 @@ export async function installTools(
191191
failures.push({ tool, reason: failed });
192192
} else if (tool.name === 'gopls') {
193193
// Restart the language server if a new binary has been installed.
194-
vscode.commands.executeCommand('go.languageserver.restart', RestartReason.INSTALLATION);
194+
try {
195+
vscode.commands.executeCommand('go.languageserver.restart', RestartReason.INSTALLATION);
196+
} catch (e) {
197+
vscode.window.showErrorMessage(`Failed to start language server: ${e}`);
198+
}
195199
}
196200
}
197201

0 commit comments

Comments
 (0)