aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md14
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs4
-rw-r--r--crates/ra_lsp_server/src/req.rs22
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/main.rs2
-rw-r--r--editors/README.md2
-rw-r--r--editors/code/package.json50
-rw-r--r--editors/code/src/commands/analyzer_status.ts9
-rw-r--r--editors/code/src/commands/extend_selection.ts2
-rw-r--r--editors/code/src/commands/join_lines.ts2
-rw-r--r--editors/code/src/commands/matching_brace.ts2
-rw-r--r--editors/code/src/commands/on_enter.ts2
-rw-r--r--editors/code/src/commands/parent_module.ts2
-rw-r--r--editors/code/src/commands/runnables.ts2
-rw-r--r--editors/code/src/commands/syntaxTree.ts4
-rw-r--r--editors/code/src/config.ts2
-rw-r--r--editors/code/src/events/change_active_text_editor.ts2
-rw-r--r--editors/code/src/extension.ts40
-rw-r--r--editors/code/src/server.ts8
18 files changed, 94 insertions, 77 deletions
diff --git a/README.md b/README.md
index 74f281ccb..ad600d162 100644
--- a/README.md
+++ b/README.md
@@ -125,13 +125,13 @@ and trait selection) to the existing rustc.
125- [x] [textDocument/documentHighlight](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentHighlight) 125- [x] [textDocument/documentHighlight](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentHighlight)
126- [x] [textDocument/documentSymbol](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol) 126- [x] [textDocument/documentSymbol](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol)
127- [x] [textDocument/codeAction](https://microsoft.github.io/language-server-protocol/specification#textDocument_codeAction) 127- [x] [textDocument/codeAction](https://microsoft.github.io/language-server-protocol/specification#textDocument_codeAction)
128 - ra_lsp.syntaxTree 128 - rust-analyzer.syntaxTree
129 - ra_lsp.extendSelection 129 - rust-analyzer.extendSelection
130 - ra_lsp.matchingBrace 130 - rust-analyzer.matchingBrace
131 - ra_lsp.parentModule 131 - rust-analyzer.parentModule
132 - ra_lsp.joinLines 132 - rust-analyzer.joinLines
133 - ra_lsp.run 133 - rust-analyzer.run
134 - ra_lsp.analyzerStatus 134 - rust-analyzer.analyzerStatus
135- [x] [textDocument/codeLens](https://microsoft.github.io/language-server-protocol/specification#textDocument_codeLens) 135- [x] [textDocument/codeLens](https://microsoft.github.io/language-server-protocol/specification#textDocument_codeLens)
136- [ ] [textDocument/documentLink](https://microsoft.github.io/language-server-protocol/specification#codeLens_resolve) 136- [ ] [textDocument/documentLink](https://microsoft.github.io/language-server-protocol/specification#codeLens_resolve)
137- [ ] [documentLink/resolve](https://microsoft.github.io/language-server-protocol/specification#documentLink_resolve) 137- [ ] [documentLink/resolve](https://microsoft.github.io/language-server-protocol/specification#documentLink_resolve)
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index ace3da020..9478ebfb8 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -581,7 +581,7 @@ pub fn handle_code_action(
581 let edit = source_edit.try_conv_with(&world)?; 581 let edit = source_edit.try_conv_with(&world)?;
582 let cmd = Command { 582 let cmd = Command {
583 title, 583 title,
584 command: "ra-lsp.applySourceChange".to_string(), 584 command: "rust-analyzer.applySourceChange".to_string(),
585 arguments: Some(vec![to_value(edit).unwrap()]), 585 arguments: Some(vec![to_value(edit).unwrap()]),
586 }; 586 };
587 res.push(cmd); 587 res.push(cmd);
@@ -623,7 +623,7 @@ pub fn handle_code_lens(
623 range, 623 range,
624 command: Some(Command { 624 command: Some(Command {
625 title: title.into(), 625 title: title.into(),
626 command: "ra-lsp.run-single".into(), 626 command: "rust-analyzer.runSingle".into(),
627 arguments: Some(vec![to_value(r).unwrap()]), 627 arguments: Some(vec![to_value(r).unwrap()]),
628 }), 628 }),
629 data: None, 629 data: None,
diff --git a/crates/ra_lsp_server/src/req.rs b/crates/ra_lsp_server/src/req.rs
index 5968e592b..a4d890755 100644
--- a/crates/ra_lsp_server/src/req.rs
+++ b/crates/ra_lsp_server/src/req.rs
@@ -16,7 +16,7 @@ pub enum AnalyzerStatus {}
16impl Request for AnalyzerStatus { 16impl Request for AnalyzerStatus {
17 type Params = (); 17 type Params = ();
18 type Result = String; 18 type Result = String;
19 const METHOD: &'static str = "ra/analyzerStatus"; 19 const METHOD: &'static str = "rust-analyzer/analyzerStatus";
20} 20}
21 21
22pub enum CollectGarbage {} 22pub enum CollectGarbage {}
@@ -24,7 +24,7 @@ pub enum CollectGarbage {}
24impl Request for CollectGarbage { 24impl Request for CollectGarbage {
25 type Params = (); 25 type Params = ();
26 type Result = (); 26 type Result = ();
27 const METHOD: &'static str = "ra/collectGarbage"; 27 const METHOD: &'static str = "rust-analyzer/collectGarbage";
28} 28}
29 29
30pub enum SyntaxTree {} 30pub enum SyntaxTree {}
@@ -32,7 +32,7 @@ pub enum SyntaxTree {}
32impl Request for SyntaxTree { 32impl Request for SyntaxTree {
33 type Params = SyntaxTreeParams; 33 type Params = SyntaxTreeParams;
34 type Result = String; 34 type Result = String;
35 const METHOD: &'static str = "m/syntaxTree"; 35 const METHOD: &'static str = "rust-analyzer/syntaxTree";
36} 36}
37 37
38#[derive(Deserialize, Debug)] 38#[derive(Deserialize, Debug)]
@@ -46,7 +46,7 @@ pub enum ExtendSelection {}
46impl Request for ExtendSelection { 46impl Request for ExtendSelection {
47 type Params = ExtendSelectionParams; 47 type Params = ExtendSelectionParams;
48 type Result = ExtendSelectionResult; 48 type Result = ExtendSelectionResult;
49 const METHOD: &'static str = "m/extendSelection"; 49 const METHOD: &'static str = "rust-analyzer/extendSelection";
50} 50}
51 51
52#[derive(Deserialize, Debug)] 52#[derive(Deserialize, Debug)]
@@ -67,7 +67,7 @@ pub enum FindMatchingBrace {}
67impl Request for FindMatchingBrace { 67impl Request for FindMatchingBrace {
68 type Params = FindMatchingBraceParams; 68 type Params = FindMatchingBraceParams;
69 type Result = Vec<Position>; 69 type Result = Vec<Position>;
70 const METHOD: &'static str = "m/findMatchingBrace"; 70 const METHOD: &'static str = "rust-analyzer/findMatchingBrace";
71} 71}
72 72
73#[derive(Deserialize, Debug)] 73#[derive(Deserialize, Debug)]
@@ -82,14 +82,14 @@ pub enum DecorationsRequest {}
82impl Request for DecorationsRequest { 82impl Request for DecorationsRequest {
83 type Params = TextDocumentIdentifier; 83 type Params = TextDocumentIdentifier;
84 type Result = Vec<Decoration>; 84 type Result = Vec<Decoration>;
85 const METHOD: &'static str = "m/decorationsRequest"; 85 const METHOD: &'static str = "rust-analyzer/decorationsRequest";
86} 86}
87 87
88pub enum PublishDecorations {} 88pub enum PublishDecorations {}
89 89
90impl Notification for PublishDecorations { 90impl Notification for PublishDecorations {
91 type Params = PublishDecorationsParams; 91 type Params = PublishDecorationsParams;
92 const METHOD: &'static str = "m/publishDecorations"; 92 const METHOD: &'static str = "rust-analyzer/publishDecorations";
93} 93}
94 94
95#[derive(Serialize, Debug)] 95#[derive(Serialize, Debug)]
@@ -112,7 +112,7 @@ pub enum ParentModule {}
112impl Request for ParentModule { 112impl Request for ParentModule {
113 type Params = TextDocumentPositionParams; 113 type Params = TextDocumentPositionParams;
114 type Result = Vec<Location>; 114 type Result = Vec<Location>;
115 const METHOD: &'static str = "m/parentModule"; 115 const METHOD: &'static str = "rust-analyzer/parentModule";
116} 116}
117 117
118pub enum JoinLines {} 118pub enum JoinLines {}
@@ -120,7 +120,7 @@ pub enum JoinLines {}
120impl Request for JoinLines { 120impl Request for JoinLines {
121 type Params = JoinLinesParams; 121 type Params = JoinLinesParams;
122 type Result = SourceChange; 122 type Result = SourceChange;
123 const METHOD: &'static str = "m/joinLines"; 123 const METHOD: &'static str = "rust-analyzer/joinLines";
124} 124}
125 125
126#[derive(Deserialize, Debug)] 126#[derive(Deserialize, Debug)]
@@ -135,7 +135,7 @@ pub enum OnEnter {}
135impl Request for OnEnter { 135impl Request for OnEnter {
136 type Params = TextDocumentPositionParams; 136 type Params = TextDocumentPositionParams;
137 type Result = Option<SourceChange>; 137 type Result = Option<SourceChange>;
138 const METHOD: &'static str = "m/onEnter"; 138 const METHOD: &'static str = "rust-analyzer/onEnter";
139} 139}
140 140
141pub enum Runnables {} 141pub enum Runnables {}
@@ -143,7 +143,7 @@ pub enum Runnables {}
143impl Request for Runnables { 143impl Request for Runnables {
144 type Params = RunnablesParams; 144 type Params = RunnablesParams;
145 type Result = Vec<Runnable>; 145 type Result = Vec<Runnable>;
146 const METHOD: &'static str = "m/runnables"; 146 const METHOD: &'static str = "rust-analyzer/runnables";
147} 147}
148 148
149#[derive(Serialize, Deserialize, Debug)] 149#[derive(Serialize, Deserialize, Debug)]
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs
index 8b5c43a09..bfb0645a8 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/main.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs
@@ -246,7 +246,7 @@ fn main() {}
246 "label": "create module" 246 "label": "create module"
247 } 247 }
248 ], 248 ],
249 "command": "ra-lsp.applySourceChange", 249 "command": "rust-analyzer.applySourceChange",
250 "title": "create module" 250 "title": "create module"
251 } 251 }
252 ]), 252 ]),
diff --git a/editors/README.md b/editors/README.md
index b35a1f367..2d6a3f21d 100644
--- a/editors/README.md
+++ b/editors/README.md
@@ -26,7 +26,7 @@ They are more experimental in nature and work only with VS Code.
26### Syntax highlighting 26### Syntax highlighting
27 27
28It overrides built-in highlighting, and works only with a specific theme 28It overrides built-in highlighting, and works only with a specific theme
29(zenburn). `ra-lsp.highlightingOn` setting can be used to disable it. 29(zenburn). `rust-analyzer.highlightingOn` setting can be used to disable it.
30 30
31### Go to symbol in workspace <kbd>ctrl+t</kbd> 31### Go to symbol in workspace <kbd>ctrl+t</kbd>
32 32
diff --git a/editors/code/package.json b/editors/code/package.json
index 86683eb73..05c67d822 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -72,61 +72,61 @@
72 ], 72 ],
73 "commands": [ 73 "commands": [
74 { 74 {
75 "command": "ra-lsp.syntaxTree", 75 "command": "rust-analyzer.syntaxTree",
76 "title": "Show Rust syntax tree" 76 "title": "rust-analyzer: syntax tree"
77 }, 77 },
78 { 78 {
79 "command": "ra-lsp.extendSelection", 79 "command": "rust-analyzer.extendSelection",
80 "title": "Rust Extend Selection" 80 "title": "rust-analyzer: extend selection"
81 }, 81 },
82 { 82 {
83 "command": "ra-lsp.matchingBrace", 83 "command": "rust-analyzer.matchingBrace",
84 "title": "Rust Matching Brace" 84 "title": "rust-analyzer: matching brace"
85 }, 85 },
86 { 86 {
87 "command": "ra-lsp.parentModule", 87 "command": "rust-analyzer.parentModule",
88 "title": "Rust Parent Module" 88 "title": "rust-analyzer: parent module"
89 }, 89 },
90 { 90 {
91 "command": "ra-lsp.joinLines", 91 "command": "rust-analyzer.joinLines",
92 "title": "Rust Join Lines" 92 "title": "rust-analyzer: join lines"
93 }, 93 },
94 { 94 {
95 "command": "ra-lsp.run", 95 "command": "rust-analyzer.run",
96 "title": "Rust Run" 96 "title": "rust-analyzer: run"
97 }, 97 },
98 { 98 {
99 "command": "ra-lsp.analyzerStatus", 99 "command": "rust-analyzer.analyzerStatus",
100 "title": "Status of rust-analyzer (debug)" 100 "title": "rust-analyzer: status"
101 }, 101 },
102 { 102 {
103 "command": "ra-lsp.collectGarbage", 103 "command": "rust-analyzer.collectGarbage",
104 "title": "Run rust-analyzer's GC" 104 "title": "rust-analyzer: run gc"
105 } 105 }
106 ], 106 ],
107 "keybindings": [ 107 "keybindings": [
108 { 108 {
109 "command": "ra-lsp.parentModule", 109 "command": "rust-analyzer.parentModule",
110 "key": "ctrl+u", 110 "key": "ctrl+u",
111 "when": "editorTextFocus && editorLangId == rust" 111 "when": "editorTextFocus && editorLangId == rust"
112 }, 112 },
113 { 113 {
114 "command": "ra-lsp.matchingBrace", 114 "command": "rust-analyzer.matchingBrace",
115 "key": "ctrl+shift+m", 115 "key": "ctrl+shift+m",
116 "when": "editorTextFocus && editorLangId == rust" 116 "when": "editorTextFocus && editorLangId == rust"
117 }, 117 },
118 { 118 {
119 "command": "ra-lsp.extendSelection", 119 "command": "rust-analyzer.extendSelection",
120 "key": "shift+alt+right", 120 "key": "shift+alt+right",
121 "when": "editorTextFocus && editorLangId == rust" 121 "when": "editorTextFocus && editorLangId == rust"
122 }, 122 },
123 { 123 {
124 "command": "ra-lsp.joinLines", 124 "command": "rust-analyzer.joinLines",
125 "key": "ctrl+shift+j", 125 "key": "ctrl+shift+j",
126 "when": "editorTextFocus && editorLangId == rust" 126 "when": "editorTextFocus && editorLangId == rust"
127 }, 127 },
128 { 128 {
129 "command": "ra-lsp.run", 129 "command": "rust-analyzer.run",
130 "key": "ctrl+r", 130 "key": "ctrl+r",
131 "when": "editorTextFocus && editorLangId == rust" 131 "when": "editorTextFocus && editorLangId == rust"
132 } 132 }
@@ -135,19 +135,19 @@
135 "type": "object", 135 "type": "object",
136 "title": "Rust Analyzer", 136 "title": "Rust Analyzer",
137 "properties": { 137 "properties": {
138 "ra-lsp.highlightingOn": { 138 "rust-analyzer.highlightingOn": {
139 "type": "boolean", 139 "type": "boolean",
140 "default": true, 140 "default": true,
141 "description": "Highlight Rust code (overrides built-in syntax highlighting)" 141 "description": "Highlight Rust code (overrides built-in syntax highlighting)"
142 }, 142 },
143 "ra-lsp.raLspServerPath": { 143 "rust-analyzer.raLspServerPath": {
144 "type": [ 144 "type": [
145 "string" 145 "string"
146 ], 146 ],
147 "default": "ra_lsp_server", 147 "default": "ra_lsp_server",
148 "description": "Path to ra_lsp_server executable" 148 "description": "Path to ra_lsp_server executable"
149 }, 149 },
150 "ra-lsp.trace.server": { 150 "rust-analyzer.trace.server": {
151 "type": "string", 151 "type": "string",
152 "scope": "window", 152 "scope": "window",
153 "enum": [ 153 "enum": [
@@ -156,7 +156,7 @@
156 "verbose" 156 "verbose"
157 ], 157 ],
158 "default": "off", 158 "default": "off",
159 "description": "Trace requests to the ra-lsp server" 159 "description": "Trace requests to the ra_lsp_server"
160 } 160 }
161 } 161 }
162 }, 162 },
diff --git a/editors/code/src/commands/analyzer_status.ts b/editors/code/src/commands/analyzer_status.ts
index bb46a1990..63f82c92d 100644
--- a/editors/code/src/commands/analyzer_status.ts
+++ b/editors/code/src/commands/analyzer_status.ts
@@ -1,7 +1,7 @@
1import * as vscode from 'vscode'; 1import * as vscode from 'vscode';
2import { Server } from '../server'; 2import { Server } from '../server';
3 3
4const statusUri = vscode.Uri.parse('ra-lsp-status://status'); 4const statusUri = vscode.Uri.parse('rust-analyzer-status://status');
5 5
6export class TextDocumentContentProvider 6export class TextDocumentContentProvider
7 implements vscode.TextDocumentContentProvider { 7 implements vscode.TextDocumentContentProvider {
@@ -15,7 +15,10 @@ export class TextDocumentContentProvider
15 if (editor == null) { 15 if (editor == null) {
16 return ''; 16 return '';
17 } 17 }
18 return Server.client.sendRequest<string>('ra/analyzerStatus', null); 18 return Server.client.sendRequest<string>(
19 'rust-analyzer/analyzerStatus',
20 null
21 );
19 } 22 }
20 23
21 get onDidChange(): vscode.Event<vscode.Uri> { 24 get onDidChange(): vscode.Event<vscode.Uri> {
@@ -31,7 +34,7 @@ export function makeCommand(context: vscode.ExtensionContext) {
31 const textDocumentContentProvider = new TextDocumentContentProvider(); 34 const textDocumentContentProvider = new TextDocumentContentProvider();
32 context.subscriptions.push( 35 context.subscriptions.push(
33 vscode.workspace.registerTextDocumentContentProvider( 36 vscode.workspace.registerTextDocumentContentProvider(
34 'ra-lsp-status', 37 'rust-analyzer-status',
35 textDocumentContentProvider 38 textDocumentContentProvider
36 ) 39 )
37 ); 40 );
diff --git a/editors/code/src/commands/extend_selection.ts b/editors/code/src/commands/extend_selection.ts
index 7b96bbc37..6f4187d15 100644
--- a/editors/code/src/commands/extend_selection.ts
+++ b/editors/code/src/commands/extend_selection.ts
@@ -24,7 +24,7 @@ export async function handle() {
24 textDocument: { uri: editor.document.uri.toString() } 24 textDocument: { uri: editor.document.uri.toString() }
25 }; 25 };
26 const response = await Server.client.sendRequest<ExtendSelectionResult>( 26 const response = await Server.client.sendRequest<ExtendSelectionResult>(
27 'm/extendSelection', 27 'rust-analyzer/extendSelection',
28 request 28 request
29 ); 29 );
30 editor.selections = response.selections.map((range: Range) => { 30 editor.selections = response.selections.map((range: Range) => {
diff --git a/editors/code/src/commands/join_lines.ts b/editors/code/src/commands/join_lines.ts
index 27d263b8a..0d4b12f4d 100644
--- a/editors/code/src/commands/join_lines.ts
+++ b/editors/code/src/commands/join_lines.ts
@@ -22,7 +22,7 @@ export async function handle() {
22 textDocument: { uri: editor.document.uri.toString() } 22 textDocument: { uri: editor.document.uri.toString() }
23 }; 23 };
24 const change = await Server.client.sendRequest<SourceChange>( 24 const change = await Server.client.sendRequest<SourceChange>(
25 'm/joinLines', 25 'rust-analyzer/joinLines',
26 request 26 request
27 ); 27 );
28 await applySourceChange(change); 28 await applySourceChange(change);
diff --git a/editors/code/src/commands/matching_brace.ts b/editors/code/src/commands/matching_brace.ts
index 5e6638e82..d86faf405 100644
--- a/editors/code/src/commands/matching_brace.ts
+++ b/editors/code/src/commands/matching_brace.ts
@@ -20,7 +20,7 @@ export async function handle() {
20 }) 20 })
21 }; 21 };
22 const response = await Server.client.sendRequest<Position[]>( 22 const response = await Server.client.sendRequest<Position[]>(
23 'm/findMatchingBrace', 23 'rust-analyzer/findMatchingBrace',
24 request 24 request
25 ); 25 );
26 editor.selections = editor.selections.map((sel, idx) => { 26 editor.selections = editor.selections.map((sel, idx) => {
diff --git a/editors/code/src/commands/on_enter.ts b/editors/code/src/commands/on_enter.ts
index bb376e3cb..16dcb70c8 100644
--- a/editors/code/src/commands/on_enter.ts
+++ b/editors/code/src/commands/on_enter.ts
@@ -22,7 +22,7 @@ export async function handle(event: { text: string }): Promise<boolean> {
22 ) 22 )
23 }; 23 };
24 const change = await Server.client.sendRequest<undefined | SourceChange>( 24 const change = await Server.client.sendRequest<undefined | SourceChange>(
25 'm/onEnter', 25 'rust-analyzer/onEnter',
26 request 26 request
27 ); 27 );
28 if (!change) { 28 if (!change) {
diff --git a/editors/code/src/commands/parent_module.ts b/editors/code/src/commands/parent_module.ts
index 806c3d34c..9d30b7b59 100644
--- a/editors/code/src/commands/parent_module.ts
+++ b/editors/code/src/commands/parent_module.ts
@@ -15,7 +15,7 @@ export async function handle() {
15 ) 15 )
16 }; 16 };
17 const response = await Server.client.sendRequest<lc.Location[]>( 17 const response = await Server.client.sendRequest<lc.Location[]>(
18 'm/parentModule', 18 'rust-analyzer/parentModule',
19 request 19 request
20 ); 20 );
21 const loc = response[0]; 21 const loc = response[0];
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts
index aa5817c21..d9ae56420 100644
--- a/editors/code/src/commands/runnables.ts
+++ b/editors/code/src/commands/runnables.ts
@@ -83,7 +83,7 @@ export async function handle() {
83 ) 83 )
84 }; 84 };
85 const runnables = await Server.client.sendRequest<Runnable[]>( 85 const runnables = await Server.client.sendRequest<Runnable[]>(
86 'm/runnables', 86 'rust-analyzer/runnables',
87 params 87 params
88 ); 88 );
89 const items: RunnableQuickPick[] = []; 89 const items: RunnableQuickPick[] = [];
diff --git a/editors/code/src/commands/syntaxTree.ts b/editors/code/src/commands/syntaxTree.ts
index 5d5cdd7a0..c0baf08c5 100644
--- a/editors/code/src/commands/syntaxTree.ts
+++ b/editors/code/src/commands/syntaxTree.ts
@@ -3,7 +3,7 @@ import { TextDocumentIdentifier } from 'vscode-languageclient';
3 3
4import { Server } from '../server'; 4import { Server } from '../server';
5 5
6export const syntaxTreeUri = vscode.Uri.parse('ra-lsp://syntaxtree'); 6export const syntaxTreeUri = vscode.Uri.parse('rust-analyzer://syntaxtree');
7 7
8export class TextDocumentContentProvider 8export class TextDocumentContentProvider
9 implements vscode.TextDocumentContentProvider { 9 implements vscode.TextDocumentContentProvider {
@@ -21,7 +21,7 @@ export class TextDocumentContentProvider
21 textDocument: { uri: editor.document.uri.toString() } 21 textDocument: { uri: editor.document.uri.toString() }
22 }; 22 };
23 return Server.client.sendRequest<SyntaxTreeResult>( 23 return Server.client.sendRequest<SyntaxTreeResult>(
24 'm/syntaxTree', 24 'rust-analyzer/syntaxTree',
25 request 25 request
26 ); 26 );
27 } 27 }
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index cc7a10f76..d26f5df0a 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -16,7 +16,7 @@ export class Config {
16 } 16 }
17 17
18 public userConfigChanged() { 18 public userConfigChanged() {
19 const config = vscode.workspace.getConfiguration('ra-lsp'); 19 const config = vscode.workspace.getConfiguration('rust-analyzer');
20 if (config.has('highlightingOn')) { 20 if (config.has('highlightingOn')) {
21 this.highlightingOn = config.get('highlightingOn') as boolean; 21 this.highlightingOn = config.get('highlightingOn') as boolean;
22 } 22 }
diff --git a/editors/code/src/events/change_active_text_editor.ts b/editors/code/src/events/change_active_text_editor.ts
index 0b7ceb65d..af295b2ec 100644
--- a/editors/code/src/events/change_active_text_editor.ts
+++ b/editors/code/src/events/change_active_text_editor.ts
@@ -16,7 +16,7 @@ export async function handle(editor: TextEditor | undefined) {
16 uri: editor.document.uri.toString() 16 uri: editor.document.uri.toString()
17 }; 17 };
18 const decorations = await Server.client.sendRequest<Decoration[]>( 18 const decorations = await Server.client.sendRequest<Decoration[]>(
19 'm/decorationsRequest', 19 'rust-analyzer/decorationsRequest',
20 params 20 params
21 ); 21 );
22 Server.highlighter.setHighlights(editor, decorations); 22 Server.highlighter.setHighlights(editor, decorations);
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 );
diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts
index 35fb7e3f5..0d2632708 100644
--- a/editors/code/src/server.ts
+++ b/editors/code/src/server.ts
@@ -42,8 +42,12 @@ export class Server {
42 log: (messageOrDataObject: string | any, data?: string) => { 42 log: (messageOrDataObject: string | any, data?: string) => {
43 if (typeof messageOrDataObject === 'string') { 43 if (typeof messageOrDataObject === 'string') {
44 if ( 44 if (
45 messageOrDataObject.includes('m/publishDecorations') || 45 messageOrDataObject.includes(
46 messageOrDataObject.includes('m/decorationsRequest') 46 'rust-analyzer/publishDecorations'
47 ) ||
48 messageOrDataObject.includes(
49 'rust-analyzer/decorationsRequest'
50 )
47 ) { 51 ) {
48 // Don't log publish decorations requests 52 // Don't log publish decorations requests
49 } else { 53 } else {