aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-05-22 16:33:12 +0100
committerGitHub <[email protected]>2020-05-22 16:33:12 +0100
commit2a36a2a3cc016de61a5df3165037ed689f36c423 (patch)
treebc08c40bd490c35a76bfd6849b6c372f0ab8311a /editors/code/src/commands
parent0fb71349156619e26a15ae21d7730eb9ce020446 (diff)
parent2075e77ee5784e72396c64c9ca059763508219ff (diff)
Merge #4569
4569: CodeAction groups r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
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