Enabled multi-selection support for several commands#2620
Enabled multi-selection support for several commands#2620sebjulliand merged 24 commits intomasterfrom
Conversation
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
|
👋 A new build is available for this PR based on 0b16e33. |
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
|
Edit: on second thought, prompted custom actions should be prompted once and executed many times instead of prompting each item. |
worksofliam
left a comment
There was a problem hiding this comment.
Generally the code looks ok but I left some comments.
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
|
Thanks @worksofliam ; see my comment and give it a go 😀 |
|
@sebjulliand Generally it's looking good. I want to also add at least one test case for each file system in |
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
|
@worksofliam tests are in, one for each scheme as requested. |
| export function registerActionsCommands(instance: Instance): Disposable[] { | ||
| return [ | ||
| commands.registerCommand(`code-for-ibmi.runAction`, async (target: TreeItem | BrowserItem | Uri, group?: any, action?: Action, method?: DeploymentMethod, workspaceFolder?: WorkspaceFolder) => { | ||
| commands.registerCommand(`code-for-ibmi.runAction`, async (item?: (TreeItem | BrowserItem | Uri), items?: (TreeItem | BrowserItem | Uri)[], action?: Action, method?: DeploymentMethod, workspaceFolder?: WorkspaceFolder) => { |
There was a problem hiding this comment.
Just to confirm: you changed group to items here, and I don't think this is a breaking change because group was never used, right?
There was a problem hiding this comment.
Yep, it was put here as a placeholder, when Project Explorer started to call it I think. So that second argument was mandatory in case the command was called with multiple item selected (otherwise it would have shifted the other arguments).
Long story short: it was never used (it was grayed out in the editor), now it is. 🤘🏻
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Fixed it! Turned out calling a command from the editor UI sends the command's group id as the second parameter, and not |
|
@sebjulliand I've just used your excellent change for the first time (using the prerelease version), and I have an idea for improvement: Can we show the path of the member or streamfile for which the action is being run? Currently it's a count, but it would be nice to know the file also - especially if something hangs or is slow. WDYT? 🤔 |
Thank you @chrjorgensen ! |
|
@sebjulliand Unfortunately I'm still very busy with work, so I don't have the time... 😭 |
You can count on me 🤝🏻 |
|
There you go @chrjorgensen : #2674 |



Changes
As discussed here: https://github.com/orgs/codefori/discussions/2612
This PR enables multi-selection support for the following commands:
Run multiple custom actions
Some noticeable changes were done to allow running custom actions on multiple items.
All the selected items must share the same nature (i.e. URI scheme) (otherwise a warning is shown)
If the command must be prompted
, it will do so for each item:The whole execution can now be cancelled. It will stop the process after the current item is done being processed

The output webview had been enhanced to display multiple outputs. The left side displays items' path and the right side shows the selected item output. The icon in front of the item shows the execution result (ok, failed or not run).

Running an action on a single item will only show the single output (no need for navigating through multiple results)
Search in members / Search/find in streamfiles
Finding or searching can be cancelled. The search will stop after the current path is done being processed.
Once a path has been processed, the results are added to the Search Results view, which means the view gets populated dynamically while the search is running.
How to test this PR
ctrl+clickorshift+clickto select multiple items in the Object browser or IFS browserChecklist