diff options
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r-- | editors/code/src/main.ts | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 0c4abdac8..511f17ca4 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import * as vscode from 'vscode'; | 1 | import * as vscode from 'vscode'; |
2 | import * as lc from 'vscode-languageclient'; | ||
3 | 2 | ||
4 | import * as commands from './commands'; | 3 | import * as commands from './commands'; |
5 | import { activateInlayHints } from './inlay_hints'; | 4 | import { activateInlayHints } from './inlay_hints'; |
6 | import { StatusDisplay } from './status_display'; | 5 | import { activateStatusDisplay } from './status_display'; |
7 | import { Server } from './server'; | 6 | import { Server } from './server'; |
8 | import { Ctx } from './ctx'; | 7 | import { Ctx } from './ctx'; |
9 | import { activateHighlighting } from './highlighting'; | 8 | import { activateHighlighting } from './highlighting'; |
@@ -32,18 +31,7 @@ export async function activate(context: vscode.ExtensionContext) { | |||
32 | ctx.overrideCommand('type', commands.onEnter); | 31 | ctx.overrideCommand('type', commands.onEnter); |
33 | } | 32 | } |
34 | 33 | ||
35 | const watchStatus = new StatusDisplay(ctx.config.cargoWatchOptions.command); | 34 | const startServer = () => Server.start(); |
36 | ctx.pushCleanup(watchStatus); | ||
37 | |||
38 | // Notifications are events triggered by the language server | ||
39 | const allNotifications: [string, lc.GenericNotificationHandler][] = [ | ||
40 | [ | ||
41 | '$/progress', | ||
42 | params => watchStatus.handleProgressNotification(params), | ||
43 | ], | ||
44 | ]; | ||
45 | |||
46 | const startServer = () => Server.start(allNotifications); | ||
47 | const reloadCommand = () => reloadServer(startServer); | 35 | const reloadCommand = () => reloadServer(startServer); |
48 | 36 | ||
49 | vscode.commands.registerCommand('rust-analyzer.reload', reloadCommand); | 37 | vscode.commands.registerCommand('rust-analyzer.reload', reloadCommand); |
@@ -55,6 +43,7 @@ export async function activate(context: vscode.ExtensionContext) { | |||
55 | vscode.window.showErrorMessage(e.message); | 43 | vscode.window.showErrorMessage(e.message); |
56 | } | 44 | } |
57 | 45 | ||
46 | activateStatusDisplay(ctx); | ||
58 | activateHighlighting(ctx); | 47 | activateHighlighting(ctx); |
59 | 48 | ||
60 | if (ctx.config.displayInlayHints) { | 49 | if (ctx.config.displayInlayHints) { |