mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Move all commands to ctx
This commit is contained in:
parent
da80b6c1e1
commit
3d008a78d0
3 changed files with 26 additions and 22 deletions
|
@ -1,3 +1,6 @@
|
|||
import * as vscode from 'vscode';
|
||||
import * as lc from 'vscode-languageclient';
|
||||
|
||||
import { Ctx, Cmd } from '../ctx';
|
||||
|
||||
import { analyzerStatus } from './analyzer_status';
|
||||
|
@ -16,6 +19,17 @@ function collectGarbage(ctx: Ctx): Cmd {
|
|||
};
|
||||
}
|
||||
|
||||
function showReferences(ctx: Ctx): Cmd {
|
||||
return (uri: string, position: lc.Position, locations: lc.Location[]) => {
|
||||
vscode.commands.executeCommand(
|
||||
'editor.action.showReferences',
|
||||
vscode.Uri.parse(uri),
|
||||
ctx.client.protocol2CodeConverter.asPosition(position),
|
||||
locations.map(ctx.client.protocol2CodeConverter.asLocation),
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export {
|
||||
analyzerStatus,
|
||||
expandMacro,
|
||||
|
@ -27,5 +41,6 @@ export {
|
|||
inlayHints,
|
||||
collectGarbage,
|
||||
run,
|
||||
runSingle
|
||||
runSingle,
|
||||
showReferences,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue