From 1e73811fbe634efec90a3e009a84fd8dda9f5697 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Mon, 9 Mar 2020 19:57:55 +0200 Subject: vscode: amend server installation logic to account for nightlies --- editors/code/src/main.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'editors/code/src/main.ts') diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index ecf53cf77..ee67c750c 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -8,6 +8,7 @@ import { activateHighlighting } from './highlighting'; import { ensureServerBinary } from './installation/server'; import { Config } from './config'; import { log } from './util'; +import { ensureProperExtensionVersion } from './installation/extension'; let ctx: Ctx | undefined; @@ -34,7 +35,13 @@ export async function activate(context: vscode.ExtensionContext) { const config = new Config(context); - const serverPath = await ensureServerBinary(config.serverSource); + vscode.workspace.onDidChangeConfiguration(() => ensureProperExtensionVersion(config)); + + // Don't await the user response here, otherwise we will block the lsp server bootstrap + void ensureProperExtensionVersion(config); + + const serverPath = await ensureServerBinary(config); + if (serverPath == null) { throw new Error( "Rust Analyzer Language Server is not available. " + -- cgit v1.2.3 From 028a4aa99f7f6829cab2d8968ef6b5976e9b3ee9 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Mon, 9 Mar 2020 20:53:01 +0200 Subject: vscode-postrefactor: unhandled promise rejections shall not pass --- editors/code/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editors/code/src/main.ts') diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index ee67c750c..4f46345d6 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -35,7 +35,7 @@ export async function activate(context: vscode.ExtensionContext) { const config = new Config(context); - vscode.workspace.onDidChangeConfiguration(() => ensureProperExtensionVersion(config)); + vscode.workspace.onDidChangeConfiguration(() => ensureProperExtensionVersion(config).catch(log.error)); // Don't await the user response here, otherwise we will block the lsp server bootstrap void ensureProperExtensionVersion(config); -- cgit v1.2.3 From 607d017229ce398bd7fef43aa5f4ab35914e6f31 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Mon, 9 Mar 2020 21:15:07 +0200 Subject: vscode-postrefactor: unhandled promise rejections shall not pass 2 --- editors/code/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editors/code/src/main.ts') diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 4f46345d6..8a7c81727 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -38,7 +38,7 @@ export async function activate(context: vscode.ExtensionContext) { vscode.workspace.onDidChangeConfiguration(() => ensureProperExtensionVersion(config).catch(log.error)); // Don't await the user response here, otherwise we will block the lsp server bootstrap - void ensureProperExtensionVersion(config); + void ensureProperExtensionVersion(config).catch(log.error); const serverPath = await ensureServerBinary(config); -- cgit v1.2.3