Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit abccc6c

Browse files
committed
Add reload workspace command
1 parent c0daf00 commit abccc6c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

rust-analyzer/editors/code/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"activationEvents": [
6262
"onLanguage:rust",
6363
"onCommand:rust-analyzer.analyzerStatus",
64-
"onCommand:rust-analyzer.collectGarbage",
64+
"onCommand:rust-analyzer.reloadWorkspace",
6565
"workspaceContains:**/Cargo.toml"
6666
],
6767
"main": "./out/src/main",
@@ -143,8 +143,8 @@
143143
"category": "Rust Analyzer"
144144
},
145145
{
146-
"command": "rust-analyzer.collectGarbage",
147-
"title": "Run garbage collection",
146+
"command": "rust-analyzer.reloadWorkspace",
147+
"title": "Reload workspace",
148148
"category": "Rust Analyzer"
149149
},
150150
{
@@ -815,7 +815,7 @@
815815
"when": "inRustProject"
816816
},
817817
{
818-
"command": "rust-analyzer.collectGarbage",
818+
"command": "rust-analyzer.reloadWorkspace",
819819
"when": "inRustProject"
820820
},
821821
{

rust-analyzer/editors/code/src/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ export function expandMacro(ctx: Ctx): Cmd {
330330
};
331331
}
332332

333-
export function collectGarbage(ctx: Ctx): Cmd {
334-
return async () => ctx.client.sendRequest(ra.collectGarbage, null);
333+
export function reloadWorkspace(ctx: Ctx): Cmd {
334+
return async () => ctx.client.sendRequest(ra.reloadWorkspace, null);
335335
}
336336

337337
export function showReferences(ctx: Ctx): Cmd {

rust-analyzer/editors/code/src/lsp_ext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as lc from "vscode-languageclient";
66

77
export const analyzerStatus = new lc.RequestType<null, string, void>("rust-analyzer/analyzerStatus");
88

9-
export const collectGarbage = new lc.RequestType<null, null, void>("rust-analyzer/collectGarbage");
9+
export const reloadWorkspace = new lc.RequestType<null, null, void>("rust-analyzer/reloadWorkspace");
1010

1111
export interface SyntaxTreeParams {
1212
textDocument: lc.TextDocumentIdentifier;

rust-analyzer/editors/code/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export async function activate(context: vscode.ExtensionContext) {
8888
});
8989

9090
ctx.registerCommand('analyzerStatus', commands.analyzerStatus);
91-
ctx.registerCommand('collectGarbage', commands.collectGarbage);
91+
ctx.registerCommand('reloadWorkspace', commands.reloadWorkspace);
9292
ctx.registerCommand('matchingBrace', commands.matchingBrace);
9393
ctx.registerCommand('joinLines', commands.joinLines);
9494
ctx.registerCommand('parentModule', commands.parentModule);

0 commit comments

Comments
 (0)