vscode: amend server installation logic to account for nightlies

This commit is contained in:
Veetaha 2020-03-09 19:57:55 +02:00
parent 601fc9d1ab
commit 1e73811fbe
3 changed files with 57 additions and 52 deletions

View file

@ -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. " +