aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/commands/index.ts')
-rw-r--r--editors/code/src/commands/index.ts17
1 files changed, 16 insertions, 1 deletions
diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts
index 9f4636e52..4a2e8e4db 100644
--- a/editors/code/src/commands/index.ts
+++ b/editors/code/src/commands/index.ts
@@ -1,3 +1,6 @@
1import * as vscode from 'vscode';
2import * as lc from 'vscode-languageclient';
3
1import { Ctx, Cmd } from '../ctx'; 4import { Ctx, Cmd } from '../ctx';
2 5
3import { analyzerStatus } from './analyzer_status'; 6import { analyzerStatus } from './analyzer_status';
@@ -16,6 +19,17 @@ function collectGarbage(ctx: Ctx): Cmd {
16 }; 19 };
17} 20}
18 21
22function showReferences(ctx: Ctx): Cmd {
23 return (uri: string, position: lc.Position, locations: lc.Location[]) => {
24 vscode.commands.executeCommand(
25 'editor.action.showReferences',
26 vscode.Uri.parse(uri),
27 ctx.client.protocol2CodeConverter.asPosition(position),
28 locations.map(ctx.client.protocol2CodeConverter.asLocation),
29 );
30 };
31}
32
19export { 33export {
20 analyzerStatus, 34 analyzerStatus,
21 expandMacro, 35 expandMacro,
@@ -27,5 +41,6 @@ export {
27 inlayHints, 41 inlayHints,
28 collectGarbage, 42 collectGarbage,
29 run, 43 run,
30 runSingle 44 runSingle,
45 showReferences,
31}; 46};