diff options
Diffstat (limited to 'editors/code/src/commands/index.ts')
-rw-r--r-- | editors/code/src/commands/index.ts | 22 |
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 @@ | |||
1 | import * as vscode from 'vscode'; | ||
2 | import * as lc from 'vscode-languageclient'; | ||
3 | |||
1 | import { Ctx, Cmd } from '../ctx'; | 4 | import { Ctx, Cmd } from '../ctx'; |
2 | 5 | ||
3 | import { analyzerStatus } from './analyzer_status'; | 6 | import { analyzerStatus } from './analyzer_status'; |
@@ -7,8 +10,7 @@ import { onEnter } from './on_enter'; | |||
7 | import { parentModule } from './parent_module'; | 10 | import { parentModule } from './parent_module'; |
8 | import { syntaxTree } from './syntax_tree'; | 11 | import { syntaxTree } from './syntax_tree'; |
9 | import { expandMacro } from './expand_macro'; | 12 | import { expandMacro } from './expand_macro'; |
10 | import * as inlayHints from './inlay_hints'; | 13 | import { run, runSingle } from './runnables'; |
11 | import * as runnables from './runnables'; | ||
12 | 14 | ||
13 | function collectGarbage(ctx: Ctx): Cmd { | 15 | function 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 | ||
21 | function 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 | |||
19 | export { | 32 | export { |
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 | }; |