Skip to content

Commit

Permalink
feat: rust-analyzer.reloadWorkspace command
Browse files Browse the repository at this point in the history
  • Loading branch information
keeneyetact committed Jul 2, 2020
1 parent 1826b14 commit dd5ad57
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function activate(context: ExtensionContext): Promise<void> {
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);
Expand Down
2 changes: 1 addition & 1 deletion src/lsp_ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as lc from 'vscode-languageserver-protocol';

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

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

export interface SyntaxTreeParams {
textDocument: lc.TextDocumentIdentifier;
Expand Down

0 comments on commit dd5ad57

Please sign in to comment.