aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-05-22 16:29:55 +0100
committerAleksey Kladov <[email protected]>2020-05-22 16:32:46 +0100
commit2075e77ee5784e72396c64c9ca059763508219ff (patch)
tree7a03fa418be34764403f53c5d4fc120a0dc776eb /editors/code/src/commands
parent5ef4ebff2017d7bdfa03f0eccb9960a86c9b94ca (diff)
CodeAction groups
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r--editors/code/src/commands/index.ts14
1 files changed, 5 insertions, 9 deletions
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 {
41 }; 41 };
42} 42}
43 43
44export function selectAndApplySourceChange(ctx: Ctx): Cmd { 44export function applyActionGroup(_ctx: Ctx): Cmd {
45 return async (changes: ra.SourceChange[]) => { 45 return async (actions: { label: string; edit: vscode.WorkspaceEdit }[]) => {
46 if (changes.length === 1) { 46 const selectedAction = await vscode.window.showQuickPick(actions);
47 await sourceChange.applySourceChange(ctx, changes[0]); 47 if (!selectedAction) return;
48 } else if (changes.length > 0) { 48 await applySnippetWorkspaceEdit(selectedAction.edit);
49 const selectedChange = await vscode.window.showQuickPick(changes);
50 if (!selectedChange) return;
51 await sourceChange.applySourceChange(ctx, selectedChange);
52 }
53 }; 49 };
54} 50}
55 51