diff options
-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 22450060b..51dedd5ef 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -11,6 +11,17 @@ let ctx!: Ctx; | |||
11 | export async function activate(context: vscode.ExtensionContext) { | 11 | export async function activate(context: vscode.ExtensionContext) { |
12 | ctx = new Ctx(context); | 12 | ctx = new Ctx(context); |
13 | 13 | ||
14 | // Note: we try to start the server before we register various commands, so | ||
15 | // that it registers its `onDidChangeDocument` handler before us. | ||
16 | // | ||
17 | // This a horribly, horribly wrong way to deal with this problem. | ||
18 | try { | ||
19 | await ctx.restartServer(); | ||
20 | } catch (e) { | ||
21 | vscode.window.showErrorMessage(e.message); | ||
22 | } | ||
23 | |||
24 | |||
14 | // Commands which invokes manually via command pallet, shortcut, etc. | 25 | // Commands which invokes manually via command pallet, shortcut, etc. |
15 | ctx.registerCommand('analyzerStatus', commands.analyzerStatus); | 26 | ctx.registerCommand('analyzerStatus', commands.analyzerStatus); |
16 | ctx.registerCommand('collectGarbage', commands.collectGarbage); | 27 | ctx.registerCommand('collectGarbage', commands.collectGarbage); |
@@ -33,12 +44,6 @@ export async function activate(context: vscode.ExtensionContext) { | |||
33 | activateStatusDisplay(ctx); | 44 | activateStatusDisplay(ctx); |
34 | activateHighlighting(ctx); | 45 | activateHighlighting(ctx); |
35 | activateInlayHints(ctx); | 46 | activateInlayHints(ctx); |
36 | // Start the language server, finally! | ||
37 | try { | ||
38 | await ctx.restartServer(); | ||
39 | } catch (e) { | ||
40 | vscode.window.showErrorMessage(e.message); | ||
41 | } | ||
42 | } | 47 | } |
43 | 48 | ||
44 | export async function deactivate() { | 49 | export async function deactivate() { |