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.ts22
1 files changed, 18 insertions, 4 deletions
diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts
index 325ae3da8..89af4be90 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';
@@ -7,8 +10,7 @@ import { onEnter } from './on_enter';
7import { parentModule } from './parent_module'; 10import { parentModule } from './parent_module';
8import { syntaxTree } from './syntax_tree'; 11import { syntaxTree } from './syntax_tree';
9import { expandMacro } from './expand_macro'; 12import { expandMacro } from './expand_macro';
10import * as inlayHints from './inlay_hints'; 13import { run, runSingle } from './runnables';
11import * as runnables from './runnables';
12 14
13function collectGarbage(ctx: Ctx): Cmd { 15function collectGarbage(ctx: Ctx): Cmd {
14 return async () => { 16 return async () => {
@@ -16,15 +18,27 @@ function collectGarbage(ctx: Ctx): Cmd {
16 }; 18 };
17} 19}
18 20
21function showReferences(ctx: Ctx): Cmd {
22 return (uri: string, position: lc.Position, locations: lc.Location[]) => {
23 vscode.commands.executeCommand(
24 'editor.action.showReferences',
25 vscode.Uri.parse(uri),
26 ctx.client.protocol2CodeConverter.asPosition(position),
27 locations.map(ctx.client.protocol2CodeConverter.asLocation),
28 );
29 };
30}
31
19export { 32export {
20 analyzerStatus, 33 analyzerStatus,
21 expandMacro, 34 expandMacro,
22 joinLines, 35 joinLines,
23 matchingBrace, 36 matchingBrace,
24 parentModule, 37 parentModule,
25 runnables,
26 syntaxTree, 38 syntaxTree,
27 onEnter, 39 onEnter,
28 inlayHints,
29 collectGarbage, 40 collectGarbage,
41 run,
42 runSingle,
43 showReferences,
30}; 44};