Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand PickList to support *grouping* #11468

Closed
alefragnani opened this issue Sep 2, 2016 · 10 comments
Closed

Expand PickList to support *grouping* #11468

alefragnani opened this issue Sep 2, 2016 · 10 comments
Assignees
Labels
api *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality quick-pick Quick-pick widget issues

Comments

@alefragnani
Copy link

Originally reported in #7019 (comment)

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)?

653e93ac-264a-11e6-8dda-4c0af353f65c

Thanks in advance

@shinhwagk

This comment has been minimized.

@gjsjohnmurray
Copy link
Contributor

Would the team consider a PR for this API enhancement request so QuickPickItems can be grouped?

@chrmarti
Copy link
Contributor

@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
Copy link
Contributor

@chrmarti that makes good sense to me. @alefragnani is that what you wanted?

@alefragnani
Copy link
Author

@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.

Kapture VSCode QuickPick with Grouping

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.

Thank you

@chrmarti
Copy link
Contributor

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.

@jrieken
Copy link
Member

jrieken commented Apr 28, 2020

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

@chrmarti
Copy link
Contributor

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.

@gjsjohnmurray
Copy link
Contributor

I just discovered this has also been discussed on #74967.

@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
Copy link
Contributor

Indeed thanks @gjsjohnmurray.

/duplicate #74967

@chrmarti chrmarti added the *duplicate Issue identified as a duplicate of another issue(s) label Apr 29, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality quick-pick Quick-pick widget issues
Projects
None yet
Development

No branches or pull requests

6 participants