diff options
-rw-r--r-- | editors/code/src/commands/index.ts | 8 | ||||
-rw-r--r-- | editors/code/src/main.ts | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts index 89af4be90..c28709c8a 100644 --- a/editors/code/src/commands/index.ts +++ b/editors/code/src/commands/index.ts | |||
@@ -2,6 +2,7 @@ import * as vscode from 'vscode'; | |||
2 | import * as lc from 'vscode-languageclient'; | 2 | import * as lc from 'vscode-languageclient'; |
3 | 3 | ||
4 | import { Ctx, Cmd } from '../ctx'; | 4 | import { Ctx, Cmd } from '../ctx'; |
5 | import * as sourceChange from '../source_change'; | ||
5 | 6 | ||
6 | import { analyzerStatus } from './analyzer_status'; | 7 | import { analyzerStatus } from './analyzer_status'; |
7 | import { matchingBrace } from './matching_brace'; | 8 | import { matchingBrace } from './matching_brace'; |
@@ -29,6 +30,12 @@ function showReferences(ctx: Ctx): Cmd { | |||
29 | }; | 30 | }; |
30 | } | 31 | } |
31 | 32 | ||
33 | function applySourceChange(ctx: Ctx): Cmd { | ||
34 | return async (change: sourceChange.SourceChange) => { | ||
35 | sourceChange.applySourceChange(ctx, change); | ||
36 | } | ||
37 | } | ||
38 | |||
32 | export { | 39 | export { |
33 | analyzerStatus, | 40 | analyzerStatus, |
34 | expandMacro, | 41 | expandMacro, |
@@ -41,4 +48,5 @@ export { | |||
41 | run, | 48 | run, |
42 | runSingle, | 49 | runSingle, |
43 | showReferences, | 50 | showReferences, |
51 | applySourceChange, | ||
44 | }; | 52 | }; |
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 20a3ea119..0c4abdac8 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -26,6 +26,7 @@ export async function activate(context: vscode.ExtensionContext) { | |||
26 | // Internal commands which are invoked by the server. | 26 | // Internal commands which are invoked by the server. |
27 | ctx.registerCommand('runSingle', commands.runSingle); | 27 | ctx.registerCommand('runSingle', commands.runSingle); |
28 | ctx.registerCommand('showReferences', commands.showReferences); | 28 | ctx.registerCommand('showReferences', commands.showReferences); |
29 | ctx.registerCommand('applySourceChange', commands.applySourceChange); | ||
29 | 30 | ||
30 | if (ctx.config.enableEnhancedTyping) { | 31 | if (ctx.config.enableEnhancedTyping) { |
31 | ctx.overrideCommand('type', commands.onEnter); | 32 | ctx.overrideCommand('type', commands.onEnter); |