Jamal Carvalho submitted this change.
3 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: src/commands/startLanguageServer.ts
Insertions: 3, Deletions: 1.
@@ -96,7 +96,9 @@
updateStatus(goCtx, goConfig, true);
console.log(`Server: ${JSON.stringify(goCtx.serverInfo, null, 2)}`);
} catch (e) {
- console.log(`Error starting language server: ${e}`);
+ const msg = `Error starting language server: ${e}`;
+ console.log(msg);
+ goCtx.serverOutputChannel?.append(msg);
} finally {
goCtx.latestConfig = cfg;
unlock();
```
src/commands: catch errors when starting language server
Added a catch block to the start language server logic
to ensure the rest of the extension activation completes.
Change-Id: I1664da130a981ef8034d1f0e8723b72a4be2d594
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/413424
Run-TryBot: Jamal Carvalho <ja...@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hya...@gmail.com>
---
M src/commands/startLanguageServer.ts
M src/goMain.ts
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/src/commands/startLanguageServer.ts b/src/commands/startLanguageServer.ts
index 466cbdf..703c5ee 100644
--- a/src/commands/startLanguageServer.ts
+++ b/src/commands/startLanguageServer.ts
@@ -95,6 +95,10 @@
goCtx.serverInfo = toServerInfo(goCtx.languageClient.initializeResult);
updateStatus(goCtx, goConfig, true);
console.log(`Server: ${JSON.stringify(goCtx.serverInfo, null, 2)}`);
+ } catch (e) {
+ const msg = `Error starting language server: ${e}`;
+ console.log(msg);
+ goCtx.serverOutputChannel?.append(msg);
} finally {
goCtx.latestConfig = cfg;
unlock();
diff --git a/src/goMain.ts b/src/goMain.ts
index af0a716..0213e03 100644
--- a/src/goMain.ts
+++ b/src/goMain.ts
@@ -102,13 +102,13 @@
offerToInstallLatestGoVersion();
offerToInstallTools();
+ const registerCommand = commands.createRegisterCommand(ctx, goCtx);
+ registerCommand('go.languageserver.restart', commands.startLanguageServer);
+
await commands.startLanguageServer(ctx, goCtx)(RestartReason.ACTIVATION);
initCoverageDecorators(ctx);
- const registerCommand = commands.createRegisterCommand(ctx, goCtx);
-
- registerCommand('go.languageserver.restart', commands.startLanguageServer);
registerCommand('go.builds.run', commands.runBuilds);
const activeDoc = vscode.window.activeTextEditor?.document;
To view, visit change 413424. To unsubscribe, or for help writing mail filters, visit settings.
Hyang-Ah Hana Kim submitted this change.
[release] src/commands: catch errors when starting language server
Added a catch block to the start language server logic
to ensure the rest of the extension activation completes.
Change-Id: I1664da130a981ef8034d1f0e8723b72a4be2d594
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/413424
Run-TryBot: Jamal Carvalho <ja...@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hya...@gmail.com>
(cherry picked from commit 8dfd39349da7a523b4ed0f781c9d10c753be76bf)
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/414458
Run-TryBot: Hyang-Ah Hana Kim <hya...@gmail.com>
TryBot-Result: kokoro <noreply...@google.com>
Reviewed-by: Suzy Mueller <suz...@golang.org>
---
M src/commands/startLanguageServer.ts
M src/goMain.ts
2 files changed, 27 insertions(+), 3 deletions(-)
To view, visit change 414458. To unsubscribe, or for help writing mail filters, visit settings.