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
{{ message }}
Repository navigation
Have createQuickPick no longer sort by label #73904
Similar to #63050, I wish to avoid the final sort on the quick pick list. I am using the quickpick as a search field, and the items field I set is already sorted by my relevance metric, so I do not want to have VS Code sort the list again . Specifically, I want an option to skip this block:
Reacted by Evan Krause, Maik Riechert, lol, Marco Wettstein, Ryan Bigg, Felix, Katelyn Nienaber, Kartik Raj, BF Software, LLC, Julien Saulou and 15 more
I would like to implement this by adding a property sortByValue to QuickPickOptions on the extension API (true by default) to control this sorting. Does that sound reasonable and would you review such a PR? Christof Marti (@chrmarti)
Christof Marti (@chrmarti) highlighting the search term's not in the scope of this issue. Could you explain why you brought it up?
I am concerned the sorting case in particular because this sort() call happens in the renderer itself. Since the extension API expects a list of items rather than a set or map, it seems logical to me to let the extension to decide that this list is already sorted and let the renderer save some processing time (especially for large lists).
Thanks for responding! I also noticed that filter/highlight can only be toggled for the description and detail fields, not the label field.
I imagine there was some kind of discussion when the API was originally added about its long-term vision; unfortunately that was before 'Hello Code' so it isn't in public history.
Allowing the extension to decide whether to sort results will let it provide a better experience to the user any time the default metric of 'index of first match' is not the best one.
For another example, an extension might want to keep the list grouped by category, similar to how built-in file search quickpick groups Recently opened, Search results, and Document symbols in that order.
We could add matchOnLabel (like we internally already did) to the API and couple that with filtering, highlighting and sorting. (Currently the sorting is only done based on the label.) That would fit nicely with the existing API while not exposing too fine-grained options that are hard to use.
Reacted by diabolicle, lol, Richard Manthorpe, Altair J. Fernandes and Lennard Sprong
After reading the discussion I still fail to understand how we went from optional sorting feature request to discussing filtering options which are not dependent on sorting in any way....
When you want to control sorting yourself, you probably also want to control filtering. I don't want to introduce a flag specific to sorting now only to discover that doesn't solve the entire issue.
Reacted by BF Software, LLC, Lemmingh and Lennard Sprong
Right, yeah it's a change we'd like to make to get a read on how many extensions depend on the existing behavior. Our suspicion is that this existing behavior is hurting extensions more than it helps and thus the behavior of the API should change.
Naturally, this is not an actual API breakage, since no API shape is changing... it's a behavior difference.
There is a chance that such a change would cause issues... if so, we'll re-evaluate.
I'm new to developing for VSCode and am very interested in this API-change (to create a go-to symbol that is closer to the one from sublime text), but seeing that it got put back into the backlog after being part of milestone twice is confusing to me.
Does that mean it won't happen in the near future? Was it decided to not implement this change after all?
Reacted by Dmitrii Puzyrev, Oliver Butler and Logonz
Naturally, this is not an actual API breakage, since no API shape is changing... it's a behavior difference. - TylerLeonhardt
TylerLeonhardt I'd argue this is actually an API breakage. An API encompasses not only what is exposed through interface but also the behavior that users have come to expect.
If you are going to change external facing behaviors of APIs highly consider deprecating and introducing new APIs instead of changing behavior under the customers, which can break usages in unknown ways.
I successfully avoided misleading sort by zipping zero-width spaces into the label, so that the QuickPickItem can never be matched and sorted, and i can sort & filter items manually myself. The only downside is that the incremental matched-highlight will missing, but i think it's not a big problem against the chaotic ordered items... Put it here for those who desperately want this feature lol
classManualSortItemimplementsvscode.QuickPickItem{label: string="";origLabel: string="";getlabelText(){returnthis.origLabel;}setlabelText(text: string){// Listen to me you VSCode scum: you can root around all you want, but// you'll never match me, and you'll never sort me! You call yourself a// programmer?this.label=[...text].join("\u200B");this.origLabel=text;}constructor(label: string){this.labelText=label;}}
Any news on the stabilization of this proposed API? This is extremely useful when custom sorting is essential to list items in the order the user expects them. It's not the first time we have complaints from users asking us "why is the last value I added here being shown last in the quick pick when I use a filter"?
Activity
pelmers commentedon Jun 24, 2019
I would like to implement this by adding a property
sortByValuetoQuickPickOptionson the extension API (trueby default) to control this sorting. Does that sound reasonable and would you review such a PR? Christof Marti (@chrmarti)chrmarti commentedon Jun 25, 2019
I wonder if that would be sufficient. What about the highlighting of the search term on the labels? Would you want to turn that off too?
pelmers commentedon Jun 25, 2019
Christof Marti (@chrmarti) highlighting the search term's not in the scope of this issue. Could you explain why you brought it up?
I am concerned the sorting case in particular because this sort() call happens in the renderer itself. Since the extension API expects a list of items rather than a set or map, it seems logical to me to let the extension to decide that this list is already sorted and let the renderer save some processing time (especially for large lists).
chrmarti commentedon Jun 26, 2019
I don't want to add API without understanding the long-term direction and the highlighting, filtering and sorting all play into this.
The QuickPickOptions already have matchOnDescription and matchOnDetail flags and these control filtering and highlighting.
pelmers commentedon Jun 26, 2019
Thanks for responding! I also noticed that filter/highlight can only be toggled for the description and detail fields, not the label field.
I imagine there was some kind of discussion when the API was originally added about its long-term vision; unfortunately that was before 'Hello Code' so it isn't in public history.
Allowing the extension to decide whether to sort results will let it provide a better experience to the user any time the default metric of 'index of first match' is not the best one.
For another example, an extension might want to keep the list grouped by category, similar to how built-in file search quickpick groups Recently opened, Search results, and Document symbols in that order.
chrmarti commentedon Jun 28, 2019
We could add
matchOnLabel(like we internally already did) to the API and couple that with filtering, highlighting and sorting. (Currently the sorting is only done based on the label.) That would fit nicely with the existing API while not exposing too fine-grained options that are hard to use.sergei-dyshel commentedon Jun 29, 2019
After reading the discussion I still fail to understand how we went from optional sorting feature request to discussing filtering options which are not dependent on sorting in any way....
chrmarti commentedon Jul 1, 2019
When you want to control sorting yourself, you probably also want to control filtering. I don't want to introduce a flag specific to sorting now only to discover that doesn't solve the entire issue.
57 remaining items
[-]Add option to skip sorting QuickPick items[/-][+]Have `createQuickPick` no longer sort by label[/+]gjsjohnmurray commentedon Feb 1, 2024
TylerLeonhardt I'm trying to understand how this won't be a breaking change.
TylerLeonhardt commentedon Feb 2, 2024
Right, yeah it's a change we'd like to make to get a read on how many extensions depend on the existing behavior. Our suspicion is that this existing behavior is hurting extensions more than it helps and thus the behavior of the API should change.
Naturally, this is not an actual API breakage, since no API shape is changing... it's a behavior difference.
There is a chance that such a change would cause issues... if so, we'll re-evaluate.
simonvanbernem commentedon Jun 10, 2024
Hi,
I'm new to developing for VSCode and am very interested in this API-change (to create a go-to symbol that is closer to the one from sublime text), but seeing that it got put back into the backlog after being part of milestone twice is confusing to me.
Does that mean it won't happen in the near future? Was it decided to not implement this change after all?
nickolay-kondratyev commentedon Nov 13, 2025
TylerLeonhardt I'd argue this is actually an API breakage. An API encompasses not only what is exposed through interface but also the behavior that users have come to expect.
See Hyrum's Law
If you are going to change external facing behaviors of APIs highly consider deprecating and introducing new APIs instead of changing behavior under the customers, which can break usages in unknown ways.
Luke-Callaghan23 commentedon Apr 3, 2026
Is there any plan for this coming back around in the future? I'd be interested in seeing this change as well.
calsys456 commentedon Apr 24, 2026
I successfully avoided misleading sort by zipping zero-width spaces into the label, so that the QuickPickItem can never be matched and sorted, and i can sort & filter items manually myself. The only downside is that the incremental matched-highlight will missing, but i think it's not a big problem against the chaotic ordered items... Put it here for those who desperately want this feature lol
lppedd commentedon Nov 20, 2026
Any news on the stabilization of this proposed API? This is extremely useful when custom sorting is essential to list items in the order the user expects them. It's not the first time we have complaints from users asking us "why is the last value I added here being shown last in the quick pick when I use a filter"?