File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,17 @@ let ctx!: Ctx;
11
11
export async function activate ( context : vscode . ExtensionContext ) {
12
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
25
// Commands which invokes manually via command pallet, shortcut, etc.
15
26
ctx . registerCommand ( 'analyzerStatus' , commands . analyzerStatus ) ;
16
27
ctx . registerCommand ( 'collectGarbage' , commands . collectGarbage ) ;
@@ -33,12 +44,6 @@ export async function activate(context: vscode.ExtensionContext) {
33
44
activateStatusDisplay ( ctx ) ;
34
45
activateHighlighting ( ctx ) ;
35
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
49
export async function deactivate ( ) {
You can’t perform that action at this time.
0 commit comments