Skip to content

Expand PickList to support *grouping* #11468

Closed

Description

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

Activity

  1. added
    feature-request
    on Sep 5, 2016
  2. shinhwagk commented on Apr 20, 2019

    @shinhwagk
  3. gjsjohnmurray commented on Apr 24, 2020

    @gjsjohnmurray
    Contributor

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

  4. chrmarti commented on Apr 27, 2020

    @chrmarti
    Collaborator

    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.

  5. gjsjohnmurray commented on Apr 27, 2020

    @gjsjohnmurray
    Contributor

    Christof Marti (@chrmarti) that makes good sense to me. Alessandro Fragnani (@alefragnani) is that what you wanted?

  6. alefragnani commented on Apr 28, 2020

    @alefragnani
    Author

    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.

    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

  7. chrmarti commented on Apr 28, 2020

    @chrmarti
    Collaborator

    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.

  8. jrieken commented on Apr 28, 2020

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

  9. chrmarti commented on Apr 28, 2020

    @chrmarti
    Collaborator

    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.

  10. gjsjohnmurray commented on Apr 28, 2020

    @gjsjohnmurray
    Contributor

    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.

  11. chrmarti commented on Apr 29, 2020

    @chrmarti
    Collaborator

    Indeed thanks John Murray (@gjsjohnmurray).

    /duplicate #74967

  12. added
    *duplicate
    on Apr 29, 2020
  13. locked and limited conversation to collaborators on Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicateapifeature-requestquick-pick

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions