From 2075e77ee5784e72396c64c9ca059763508219ff Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 22 May 2020 17:29:55 +0200 Subject: CodeAction groups --- editors/code/src/commands/index.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'editors/code/src/commands') diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts index e5ed77e32..abb53a248 100644 --- a/editors/code/src/commands/index.ts +++ b/editors/code/src/commands/index.ts @@ -41,15 +41,11 @@ export function applySourceChange(ctx: Ctx): Cmd { }; } -export function selectAndApplySourceChange(ctx: Ctx): Cmd { - return async (changes: ra.SourceChange[]) => { - if (changes.length === 1) { - await sourceChange.applySourceChange(ctx, changes[0]); - } else if (changes.length > 0) { - const selectedChange = await vscode.window.showQuickPick(changes); - if (!selectedChange) return; - await sourceChange.applySourceChange(ctx, selectedChange); - } +export function applyActionGroup(_ctx: Ctx): Cmd { + return async (actions: { label: string; edit: vscode.WorkspaceEdit }[]) => { + const selectedAction = await vscode.window.showQuickPick(actions); + if (!selectedAction) return; + await applySnippetWorkspaceEdit(selectedAction.edit); }; } -- cgit v1.2.3