diff --git a/README.md b/README.md index 944c80db..874c38ee 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Settings not specific to `rust-analyzer` can be found at `:help coc-configuratio You can use these commands by `:CocCommand XYZ`. - `rust-analyzer.analyzerStatus`: Show rust-analyzer status -- `rust-analyzer.collectGarbage`: Run garbage collection +- `rust-analyzer.reloadWorkspace`: Reload workspace - `rust-analyzer.expandMacro`: Expand macro recursively - `rust-analyzer.joinLines`: Join lines - `rust-analyzer.matchingBrace`: Find matching brace diff --git a/package.json b/package.json index 205426b8..753d34bd 100644 --- a/package.json +++ b/package.json @@ -346,8 +346,8 @@ "category": "Rust Analyzer" }, { - "command": "rust-analyzer.collectGarbage", - "title": "Run garbage collection", + "command": "rust-analyzer.reloadWorkspace", + "title": "Reload workspace", "category": "Rust Analyzer" }, { diff --git a/src/commands.ts b/src/commands.ts index d2f52a5a..f40bad05 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -229,9 +229,9 @@ export function expandMacro(ctx: Ctx): Cmd { }; } -export function collectGarbage(ctx: Ctx): Cmd { +export function reloadWorkspace(ctx: Ctx): Cmd { return async () => { - await ctx.client.sendRequest(ra.collectGarbage, null); + await ctx.client.sendRequest(ra.reloadWorkspace, null); }; } diff --git a/src/index.ts b/src/index.ts index 5d3c1624..abace54c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,7 +40,7 @@ export async function activate(context: ExtensionContext): Promise { ctx.registerCommand('analyzerStatus', cmds.analyzerStatus); ctx.registerCommand('applySnippetWorkspaceEdit', cmds.applySnippetWorkspaceEditCommand); ctx.registerCommand('resolveCodeAction', cmds.resolveCodeAction); - ctx.registerCommand('collectGarbage', cmds.collectGarbage); + ctx.registerCommand('reloadWorkspace', cmds.reloadWorkspace); ctx.registerCommand('expandMacro', cmds.expandMacro); ctx.registerCommand('joinLines', cmds.joinLines); ctx.registerCommand('matchingBrace', cmds.matchingBrace); diff --git a/src/lsp_ext.ts b/src/lsp_ext.ts index bec94dcd..e8a62319 100644 --- a/src/lsp_ext.ts +++ b/src/lsp_ext.ts @@ -6,7 +6,7 @@ import * as lc from 'vscode-languageserver-protocol'; export const analyzerStatus = new lc.RequestType('rust-analyzer/analyzerStatus'); -export const collectGarbage = new lc.RequestType('rust-analyzer/collectGarbage'); +export const reloadWorkspace = new lc.RequestType('rust-analyzer/reloadWorkspace'); export interface SyntaxTreeParams { textDocument: lc.TextDocumentIdentifier;