diff options
author | Aleksey Kladov <[email protected]> | 2019-12-30 19:07:04 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-12-30 19:07:04 +0000 |
commit | 3d008a78d0ab1d43629326d58d4b2a157303dd00 (patch) | |
tree | 393c5cb5ad9249409808dc46cc7a344b79958ab1 /editors/code/src/commands/index.ts | |
parent | da80b6c1e1c09831b2f30233ddacaf50fa58f812 (diff) |
Move all commands to ctx
Diffstat (limited to 'editors/code/src/commands/index.ts')
-rw-r--r-- | editors/code/src/commands/index.ts | 17 |
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 @@ | |||
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'; |
@@ -16,6 +19,17 @@ function collectGarbage(ctx: Ctx): Cmd { | |||
16 | }; | 19 | }; |
17 | } | 20 | } |
18 | 21 | ||
22 | function 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 | |||
19 | export { | 33 | export { |
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 | }; |