diff options
author | Aleksey Kladov <[email protected]> | 2019-12-30 13:53:43 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-12-30 13:53:43 +0000 |
commit | 29e86c0c726c20cf1add94a322b9c147b67ca1f6 (patch) | |
tree | fc9842d28586acb138fb228730555812ebd6e98f /editors/code/src/commands | |
parent | e53ccb6e99bb0e92ebea19f150c8fbf9b6958634 (diff) |
More second command to Ctx
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r-- | editors/code/src/commands/analyzer_status.ts | 4 | ||||
-rw-r--r-- | editors/code/src/commands/index.ts | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/editors/code/src/commands/analyzer_status.ts b/editors/code/src/commands/analyzer_status.ts index 6e92c50ef..c9d32fe07 100644 --- a/editors/code/src/commands/analyzer_status.ts +++ b/editors/code/src/commands/analyzer_status.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import * as vscode from 'vscode'; | 1 | import * as vscode from 'vscode'; |
2 | import { Ctx } from '../ctx'; | 2 | import { Ctx, Cmd } from '../ctx'; |
3 | // Shows status of rust-analyzer (for debugging) | 3 | // Shows status of rust-analyzer (for debugging) |
4 | 4 | ||
5 | export function analyzerStatus(ctx: Ctx) { | 5 | export function analyzerStatus(ctx: Ctx): Cmd { |
6 | let poller: NodeJS.Timer | null = null; | 6 | let poller: NodeJS.Timer | null = null; |
7 | const tdcp = new TextDocumentContentProvider(ctx); | 7 | const tdcp = new TextDocumentContentProvider(ctx); |
8 | 8 | ||
diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts index ec1995396..ed56f5a4e 100644 --- a/editors/code/src/commands/index.ts +++ b/editors/code/src/commands/index.ts | |||
@@ -1,3 +1,5 @@ | |||
1 | import { Ctx, Cmd } from '../ctx' | ||
2 | |||
1 | import { analyzerStatus } from './analyzer_status'; | 3 | import { analyzerStatus } from './analyzer_status'; |
2 | import * as applySourceChange from './apply_source_change'; | 4 | import * as applySourceChange from './apply_source_change'; |
3 | import * as expandMacro from './expand_macro'; | 5 | import * as expandMacro from './expand_macro'; |
@@ -9,6 +11,10 @@ import * as parentModule from './parent_module'; | |||
9 | import * as runnables from './runnables'; | 11 | import * as runnables from './runnables'; |
10 | import * as syntaxTree from './syntaxTree'; | 12 | import * as syntaxTree from './syntaxTree'; |
11 | 13 | ||
14 | function collectGarbage(ctx: Ctx): Cmd { | ||
15 | return async () => { ctx.client.sendRequest<null>('rust-analyzer/collectGarbage', null) } | ||
16 | } | ||
17 | |||
12 | export { | 18 | export { |
13 | analyzerStatus, | 19 | analyzerStatus, |
14 | applySourceChange, | 20 | applySourceChange, |
@@ -20,4 +26,5 @@ export { | |||
20 | syntaxTree, | 26 | syntaxTree, |
21 | onEnter, | 27 | onEnter, |
22 | inlayHints, | 28 | inlayHints, |
29 | collectGarbage | ||
23 | }; | 30 | }; |