]> git.lizzy.rs Git - rust.git/commitdiff
Restore internal applySourceChange command
authorAleksey Kladov <aleksey.kladov@gmail.com>
Mon, 30 Dec 2019 22:45:50 +0000 (23:45 +0100)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Mon, 30 Dec 2019 22:46:13 +0000 (23:46 +0100)
editors/code/src/commands/index.ts
editors/code/src/main.ts

index 89af4be900c408071e738a3ad05459af1162c58e..c28709c8a025e63558b63408a44c4c0a1c9e171e 100644 (file)
@@ -2,6 +2,7 @@ import * as vscode from 'vscode';
 import * as lc from 'vscode-languageclient';
 
 import { Ctx, Cmd } from '../ctx';
+import * as sourceChange from '../source_change';
 
 import { analyzerStatus } from './analyzer_status';
 import { matchingBrace } from './matching_brace';
@@ -29,6 +30,12 @@ function showReferences(ctx: Ctx): Cmd {
     };
 }
 
+function applySourceChange(ctx: Ctx): Cmd {
+    return async (change: sourceChange.SourceChange) => {
+        sourceChange.applySourceChange(ctx, change);
+    }
+}
+
 export {
     analyzerStatus,
     expandMacro,
@@ -41,4 +48,5 @@ export {
     run,
     runSingle,
     showReferences,
+    applySourceChange,
 };
index 20a3ea11979858d06f01bd2231466c3f2e9768df..0c4abdac89fe89f64b512997b182545c54110c04 100644 (file)
@@ -26,6 +26,7 @@ export async function activate(context: vscode.ExtensionContext) {
     // Internal commands which are invoked by the server.
     ctx.registerCommand('runSingle', commands.runSingle);
     ctx.registerCommand('showReferences', commands.showReferences);
+    ctx.registerCommand('applySourceChange', commands.applySourceChange);
 
     if (ctx.config.enableEnhancedTyping) {
         ctx.overrideCommand('type', commands.onEnter);