aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-01 13:57:59 +0100
committerAleksey Kladov <[email protected]>2020-07-01 13:57:59 +0100
commitc9f878962a7c9d1c33d5834a1dce2106c9286699 (patch)
tree1d66c4008b662dc8bcd703b146b7cb7e92e597b1 /editors/code
parentec8b4dca02e454bf110f799b1ae8ebf939c0e233 (diff)
Add reload workspace command
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/package.json8
-rw-r--r--editors/code/src/commands.ts4
-rw-r--r--editors/code/src/lsp_ext.ts2
-rw-r--r--editors/code/src/main.ts2
4 files changed, 8 insertions, 8 deletions
diff --git a/editors/code/package.json b/editors/code/package.json
index fcb101fc6..af0a5c851 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -61,7 +61,7 @@
61 "activationEvents": [ 61 "activationEvents": [
62 "onLanguage:rust", 62 "onLanguage:rust",
63 "onCommand:rust-analyzer.analyzerStatus", 63 "onCommand:rust-analyzer.analyzerStatus",
64 "onCommand:rust-analyzer.collectGarbage", 64 "onCommand:rust-analyzer.reloadWorkspace",
65 "workspaceContains:**/Cargo.toml" 65 "workspaceContains:**/Cargo.toml"
66 ], 66 ],
67 "main": "./out/src/main", 67 "main": "./out/src/main",
@@ -143,8 +143,8 @@
143 "category": "Rust Analyzer" 143 "category": "Rust Analyzer"
144 }, 144 },
145 { 145 {
146 "command": "rust-analyzer.collectGarbage", 146 "command": "rust-analyzer.reloadWorkspace",
147 "title": "Run garbage collection", 147 "title": "Reload workspace",
148 "category": "Rust Analyzer" 148 "category": "Rust Analyzer"
149 }, 149 },
150 { 150 {
@@ -815,7 +815,7 @@
815 "when": "inRustProject" 815 "when": "inRustProject"
816 }, 816 },
817 { 817 {
818 "command": "rust-analyzer.collectGarbage", 818 "command": "rust-analyzer.reloadWorkspace",
819 "when": "inRustProject" 819 "when": "inRustProject"
820 }, 820 },
821 { 821 {
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index 0e78f5101..19a9c2a0d 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -330,8 +330,8 @@ export function expandMacro(ctx: Ctx): Cmd {
330 }; 330 };
331} 331}
332 332
333export function collectGarbage(ctx: Ctx): Cmd { 333export function reloadWorkspace(ctx: Ctx): Cmd {
334 return async () => ctx.client.sendRequest(ra.collectGarbage, null); 334 return async () => ctx.client.sendRequest(ra.reloadWorkspace, null);
335} 335}
336 336
337export function showReferences(ctx: Ctx): Cmd { 337export function showReferences(ctx: Ctx): Cmd {
diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts
index fdb99956b..981b6f40e 100644
--- a/editors/code/src/lsp_ext.ts
+++ b/editors/code/src/lsp_ext.ts
@@ -6,7 +6,7 @@ import * as lc from "vscode-languageclient";
6 6
7export const analyzerStatus = new lc.RequestType<null, string, void>("rust-analyzer/analyzerStatus"); 7export const analyzerStatus = new lc.RequestType<null, string, void>("rust-analyzer/analyzerStatus");
8 8
9export const collectGarbage = new lc.RequestType<null, null, void>("rust-analyzer/collectGarbage"); 9export const reloadWorkspace = new lc.RequestType<null, null, void>("rust-analyzer/reloadWorkspace");
10 10
11export interface SyntaxTreeParams { 11export interface SyntaxTreeParams {
12 textDocument: lc.TextDocumentIdentifier; 12 textDocument: lc.TextDocumentIdentifier;
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 5ceab8b44..2982b9cbf 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -88,7 +88,7 @@ export async function activate(context: vscode.ExtensionContext) {
88 }); 88 });
89 89
90 ctx.registerCommand('analyzerStatus', commands.analyzerStatus); 90 ctx.registerCommand('analyzerStatus', commands.analyzerStatus);
91 ctx.registerCommand('collectGarbage', commands.collectGarbage); 91 ctx.registerCommand('reloadWorkspace', commands.reloadWorkspace);
92 ctx.registerCommand('matchingBrace', commands.matchingBrace); 92 ctx.registerCommand('matchingBrace', commands.matchingBrace);
93 ctx.registerCommand('joinLines', commands.joinLines); 93 ctx.registerCommand('joinLines', commands.joinLines);
94 ctx.registerCommand('parentModule', commands.parentModule); 94 ctx.registerCommand('parentModule', commands.parentModule);