diff options
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r-- | editors/code/src/main.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index cf0ddfa16..d6c210579 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -3,7 +3,7 @@ import * as lc from 'vscode-languageclient'; | |||
3 | 3 | ||
4 | import * as commands from './commands'; | 4 | import * as commands from './commands'; |
5 | import { HintsUpdater } from './inlay_hints'; | 5 | import { HintsUpdater } from './inlay_hints'; |
6 | import { StatusDisplay } from './commands/watch_status'; | 6 | import { StatusDisplay } from './status_display'; |
7 | import * as events from './events'; | 7 | import * as events from './events'; |
8 | import * as notifications from './notifications'; | 8 | import * as notifications from './notifications'; |
9 | import { Server } from './server'; | 9 | import { Server } from './server'; |
@@ -28,10 +28,6 @@ export async function activate(context: vscode.ExtensionContext) { | |||
28 | ctx.registerCommand('runSingle', commands.runSingle); | 28 | ctx.registerCommand('runSingle', commands.runSingle); |
29 | ctx.registerCommand('showReferences', commands.showReferences); | 29 | ctx.registerCommand('showReferences', commands.showReferences); |
30 | 30 | ||
31 | function disposeOnDeactivation(disposable: vscode.Disposable) { | ||
32 | context.subscriptions.push(disposable); | ||
33 | } | ||
34 | |||
35 | if (Server.config.enableEnhancedTyping) { | 31 | if (Server.config.enableEnhancedTyping) { |
36 | ctx.overrideCommand('type', commands.onEnter); | 32 | ctx.overrideCommand('type', commands.onEnter); |
37 | } | 33 | } |
@@ -39,7 +35,11 @@ export async function activate(context: vscode.ExtensionContext) { | |||
39 | const watchStatus = new StatusDisplay( | 35 | const watchStatus = new StatusDisplay( |
40 | Server.config.cargoWatchOptions.command, | 36 | Server.config.cargoWatchOptions.command, |
41 | ); | 37 | ); |
42 | disposeOnDeactivation(watchStatus); | 38 | ctx.pushCleanup(watchStatus); |
39 | |||
40 | function disposeOnDeactivation(disposable: vscode.Disposable) { | ||
41 | context.subscriptions.push(disposable); | ||
42 | } | ||
43 | 43 | ||
44 | // Notifications are events triggered by the language server | 44 | // Notifications are events triggered by the language server |
45 | const allNotifications: [string, lc.GenericNotificationHandler][] = [ | 45 | const allNotifications: [string, lc.GenericNotificationHandler][] = [ |