diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2019-12-31 18:38:22 +0100 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2019-12-31 18:38:22 +0100 |
| commit | 6368b40dd98b208da3758d4d1eed34cf276e3b09 (patch) | |
| tree | 3efa5daf54fe08cd1b310fa42c2ef469503fcedd /editors/code/src | |
| parent | 087af54069d34eef5197e04d64ac322d9ee98085 (diff) | |
| download | rust-6368b40dd98b208da3758d4d1eed34cf276e3b09.tar.gz rust-6368b40dd98b208da3758d4d1eed34cf276e3b09.zip | |
Work around synchrnonisation issue
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/main.ts | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 22450060b4a..51dedd5efc7 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -11,6 +11,17 @@ let ctx!: Ctx; export async function activate(context: vscode.ExtensionContext) { ctx = new Ctx(context); + // Note: we try to start the server before we register various commands, so + // that it registers its `onDidChangeDocument` handler before us. + // + // This a horribly, horribly wrong way to deal with this problem. + try { + await ctx.restartServer(); + } catch (e) { + vscode.window.showErrorMessage(e.message); + } + + // Commands which invokes manually via command pallet, shortcut, etc. ctx.registerCommand('analyzerStatus', commands.analyzerStatus); ctx.registerCommand('collectGarbage', commands.collectGarbage); @@ -33,12 +44,6 @@ export async function activate(context: vscode.ExtensionContext) { activateStatusDisplay(ctx); activateHighlighting(ctx); activateInlayHints(ctx); - // Start the language server, finally! - try { - await ctx.restartServer(); - } catch (e) { - vscode.window.showErrorMessage(e.message); - } } export async function deactivate() { |
