From: Aleksey Kladov Date: Mon, 30 Dec 2019 22:45:50 +0000 (+0100) Subject: Restore internal applySourceChange command X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=68b7d84974aac3c5eec98b43f63e806dac60b86e;p=rust.git Restore internal applySourceChange command --- diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts index 89af4be900c..c28709c8a02 100644 --- a/editors/code/src/commands/index.ts +++ b/editors/code/src/commands/index.ts @@ -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, }; diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 20a3ea11979..0c4abdac89f 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -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);