diff options
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r-- | editors/code/src/main.ts | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 51dedd5ef..430ad31b4 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -11,17 +11,6 @@ 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 | |||
25 | // Commands which invokes manually via command pallet, shortcut, etc. | 14 | // Commands which invokes manually via command pallet, shortcut, etc. |
26 | ctx.registerCommand('analyzerStatus', commands.analyzerStatus); | 15 | ctx.registerCommand('analyzerStatus', commands.analyzerStatus); |
27 | ctx.registerCommand('collectGarbage', commands.collectGarbage); | 16 | ctx.registerCommand('collectGarbage', commands.collectGarbage); |
@@ -42,7 +31,17 @@ export async function activate(context: vscode.ExtensionContext) { | |||
42 | ctx.overrideCommand('type', commands.onEnter); | 31 | ctx.overrideCommand('type', commands.onEnter); |
43 | } | 32 | } |
44 | activateStatusDisplay(ctx); | 33 | activateStatusDisplay(ctx); |
34 | |||
45 | activateHighlighting(ctx); | 35 | activateHighlighting(ctx); |
36 | // Note: we try to start the server before we activate type hints so that it | ||
37 | // registers its `onDidChangeDocument` handler before us. | ||
38 | // | ||
39 | // This a horribly, horribly wrong way to deal with this problem. | ||
40 | try { | ||
41 | await ctx.restartServer(); | ||
42 | } catch (e) { | ||
43 | vscode.window.showErrorMessage(e.message); | ||
44 | } | ||
46 | activateInlayHints(ctx); | 45 | activateInlayHints(ctx); |
47 | } | 46 | } |
48 | 47 | ||