You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*duplicateIssue identified as a duplicate of another issue(s)apifeature-requestRequest for new features or functionalityquick-pickQuick-pick widget issues
The idea is to show items in the pick list, just like Go to Symbol, where you have some kind of groups of items (that appears when you type '@:' in the pick list)?
Thanks in advance
Reacted by Shahar Hadas, Timothy Haryadi, Ben, Manta Anantachai S., Axetroy, Marvin Heilemann, Yu Zhang, Nzix, allenoleksak, Sefa Yavuz and 17 more
John Murray (@gjsjohnmurray) Lets first discuss the API change. Would you just surface what we use internally? There we allow the items list to be either a QuickPickItem or a QuickPickSeparator which then separates the groups and can have a label.
John Murray (@gjsjohnmurray) I never thought the API would be that way. I was thinking about a group/category data attached to each QuickPickItem and the QuickPick itself would deal with grouping and counting the items in each group (when properly turned on with a new QuickPickOptions option). At first sight, I thought the groups (line separator and labels/counting) would be generated automatically.
But, if the proposed API (QuickPickItem and QuickPickSeparator) could give me the same power/flexibility as we see today in Go to Symbol command, it would be great.
I just wonder how/if I should deal with the ordering, visibility and counting myself when the user filters the PickList, with the QuickPickSeparator. As you see, the counter changes, so should I "recreate/update" that QuickPickSeparator too?
I didn't dig in VS Code source to see how the internal API works today, but with the right documentation and samples, I guess it wouldn't be a problem.
The built-in filtering removes all separators because it also sorts across groups by the best match. Go to Symbol does its own filtering and sorting, the createQuickPick API would allow you to do the same once we support disabling sorting and filtering.
I was thinking about a group/category data attached to each QuickPickItem and the QuickPick itself would deal with grouping and counting the items in each group
I was thinking about a group/category data attached to each QuickPickItem and the QuickPick itself would deal with grouping and counting the items in each group
Big 👍 for that
We would copy the group labels across items. If the group label were alternating A, B, A, we would have two options: either sort them by first appearance or consider it distinct groups.
I like an approach without the replication and ambiguities better.
*duplicateIssue identified as a duplicate of another issue(s)apifeature-requestRequest for new features or functionalityquick-pickQuick-pick widget issues
Activity
shinhwagk commentedon Apr 20, 2019
gjsjohnmurray commentedon Apr 24, 2020
Would the team consider a PR for this API enhancement request so QuickPickItems can be grouped?
chrmarti commentedon Apr 27, 2020
John Murray (@gjsjohnmurray) Lets first discuss the API change. Would you just surface what we use internally? There we allow the items list to be either a QuickPickItem or a QuickPickSeparator which then separates the groups and can have a label.
gjsjohnmurray commentedon Apr 27, 2020
Christof Marti (@chrmarti) that makes good sense to me. Alessandro Fragnani (@alefragnani) is that what you wanted?
alefragnani commentedon Apr 28, 2020
John Murray (@gjsjohnmurray) I never thought the API would be that way. I was thinking about a group/category data attached to each
QuickPickItemand theQuickPickitself would deal with grouping and counting the items in each group (when properly turned on with a newQuickPickOptionsoption). At first sight, I thought the groups (line separator and labels/counting) would be generated automatically.But, if the proposed API (
QuickPickItemandQuickPickSeparator) could give me the same power/flexibility as we see today inGo to Symbolcommand, it would be great.I just wonder how/if I should deal with the ordering, visibility and counting myself when the user filters the PickList, with the
QuickPickSeparator. As you see, the counter changes, so should I "recreate/update" thatQuickPickSeparatortoo?I didn't dig in VS Code source to see how the internal API works today, but with the right documentation and samples, I guess it wouldn't be a problem.
Thank you
chrmarti commentedon Apr 28, 2020
The built-in filtering removes all separators because it also sorts across groups by the best match.
Go to Symboldoes its own filtering and sorting, thecreateQuickPickAPI would allow you to do the same once we support disabling sorting and filtering.jrieken commentedon Apr 28, 2020
Big 👍 for that
chrmarti commentedon Apr 28, 2020
We would copy the group labels across items. If the group label were alternating A, B, A, we would have two options: either sort them by first appearance or consider it distinct groups.
I like an approach without the replication and ambiguities better.
gjsjohnmurray commentedon Apr 28, 2020
I just discovered this has also been discussed on #74967.
Christof Marti (@chrmarti) I'll leave it to you (or someone else) to decide if that issue or this one should be closed as a dup. This one is older.
chrmarti commentedon Apr 29, 2020
Indeed thanks John Murray (@gjsjohnmurray).
/duplicate #74967