aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/extension.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/extension.ts')
-rw-r--r--editors/code/src/extension.ts40
1 files changed, 25 insertions, 15 deletions
diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts
index dc7b01403..0b2a6095b 100644
--- a/editors/code/src/extension.ts
+++ b/editors/code/src/extension.ts
@@ -46,31 +46,41 @@ export function activate(context: vscode.ExtensionContext) {
46 46
47 // Commands are requests from vscode to the language server 47 // Commands are requests from vscode to the language server
48 registerCommand( 48 registerCommand(
49 'ra-lsp.analyzerStatus', 49 'rust-analyzer.analyzerStatus',
50 commands.analyzerStatus.makeCommand(context) 50 commands.analyzerStatus.makeCommand(context)
51 ); 51 );
52 registerCommand('ra-lsp.collectGarbage', () => 52 registerCommand('rust-analyzer.collectGarbage', () =>
53 Server.client.sendRequest<null>('ra/collectGarbage', null) 53 Server.client.sendRequest<null>('rust-analyzer/collectGarbage', null)
54 ); 54 );
55 registerCommand('ra-lsp.syntaxTree', commands.syntaxTree.handle); 55 registerCommand('rust-analyzer.syntaxTree', commands.syntaxTree.handle);
56 registerCommand('ra-lsp.extendSelection', commands.extendSelection.handle);
57 registerCommand('ra-lsp.matchingBrace', commands.matchingBrace.handle);
58 registerCommand('ra-lsp.joinLines', commands.joinLines.handle);
59 registerCommand('ra-lsp.parentModule', commands.parentModule.handle);
60 registerCommand('ra-lsp.run', commands.runnables.handle);
61 registerCommand( 56 registerCommand(
62 'ra-lsp.applySourceChange', 57 'rust-analyzer.extendSelection',
58 commands.extendSelection.handle
59 );
60 registerCommand(
61 'rust-analyzer.matchingBrace',
62 commands.matchingBrace.handle
63 );
64 registerCommand('rust-analyzer.joinLines', commands.joinLines.handle);
65 registerCommand('rust-analyzer.parentModule', commands.parentModule.handle);
66 registerCommand('rust-analyzer.run', commands.runnables.handle);
67 // Unlike the above this does not send requests to the language server
68 registerCommand('rust-analyzer.runSingle', commands.runnables.handleSingle);
69 registerCommand(
70 'rust-analyzer.applySourceChange',
63 commands.applySourceChange.handle 71 commands.applySourceChange.handle
64 ); 72 );
65 overrideCommand('type', commands.onEnter.handle); 73 overrideCommand('type', commands.onEnter.handle);
66 74
67 // Unlike the above this does not send requests to the language server
68 registerCommand('ra-lsp.run-single', commands.runnables.handleSingle);
69
70 // Notifications are events triggered by the language server 75 // Notifications are events triggered by the language server
71 const allNotifications: Iterable< 76 const allNotifications: Iterable<
72 [string, lc.GenericNotificationHandler] 77 [string, lc.GenericNotificationHandler]
73 > = [['m/publishDecorations', notifications.publishDecorations.handle]]; 78 > = [
79 [
80 'rust-analyzer/publishDecorations',
81 notifications.publishDecorations.handle
82 ]
83 ];
74 84
75 // The events below are plain old javascript events, triggered and handled by vscode 85 // The events below are plain old javascript events, triggered and handled by vscode
76 vscode.window.onDidChangeActiveTextEditor( 86 vscode.window.onDidChangeActiveTextEditor(
@@ -80,7 +90,7 @@ export function activate(context: vscode.ExtensionContext) {
80 const textDocumentContentProvider = new TextDocumentContentProvider(); 90 const textDocumentContentProvider = new TextDocumentContentProvider();
81 disposeOnDeactivation( 91 disposeOnDeactivation(
82 vscode.workspace.registerTextDocumentContentProvider( 92 vscode.workspace.registerTextDocumentContentProvider(
83 'ra-lsp', 93 'rust-analyzer',
84 textDocumentContentProvider 94 textDocumentContentProvider
85 ) 95 )
86 ); 96 );