Add optional sortByLabel to QuickPick to control whether to re-sort results#77297
Closed
pelmers wants to merge 2 commits intomicrosoft:masterfrom
Closed
Add optional sortByLabel to QuickPick to control whether to re-sort results#77297pelmers wants to merge 2 commits intomicrosoft:masterfrom
pelmers wants to merge 2 commits intomicrosoft:masterfrom
Conversation
…tems when query changes Summary: Address issue microsoft#73904 by adding an optional `sortByLabel` to the QuickPick class which determines whether the picker re-sorts the result list when the user types in the input field. If true, the picker applies a sort to order results by the index of the first appearance of the input in the label. For backwards compatibility, this field is true by default. microsoft#73904 Test Plan: attached video shows behavior both before and after {F167292605} note: there aren't any existing tests on what happens when the query input changes in the QuickPick Reviewers: dalongi, ericblue, hchau Reviewed By: ericblue Differential Revision: https://phabricator.intern.facebook.com/D16203434 Signature: 16203434:1562878837:5413e3852f2bd04c8e81b9fe5c4a08127dfe3b65
roblourens
reviewed
Jul 15, 2019
src/vs/vscode.d.ts
Outdated
| /** | ||
| * An optional flag to sort the final results by index of first query match in label, defaults to true. | ||
| */ | ||
| sortByLabel?: boolean; |
Member
There was a problem hiding this comment.
These changes should be in vscode.proposed.d.ts, new API starts there until we decide to release it as stable API. More info: https://github.com/Microsoft/vscode/wiki/Extension-API-process
Summary: API additions should start off in the proposed API file.
Test Plan:
same as before, tested that I could skip sorting:
{F168164535}
Reviewers: dalongi, ericblue, hchau
Reviewed By: ericblue
Differential Revision: https://phabricator.intern.facebook.com/D16264910
Signature: 16264910:1563214616:55ecf86a9d4a0d8a0cd44d9b33eb770b2a7d04aa
Contributor
Author
|
added a region to proposed.d.ts with the changes, I put my name there as well but I'm not sure if I followed the convention correctly |
Collaborator
|
Merged manually. Thanks @pelmers ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address issue #73904 by adding an optional
sortByLabelto the QuickPick class which determines whether the picker re-sorts the result list when the user types in the input field.If true, the picker applies a sort to order results by the index of the first appearance of the input in the label.
For backwards compatibility, this field is true by default.
@chrmarti, @roblourens
Notes:
This is just a first pass the implements my initial request -- it doesn't add more fields for highlighting or behaviors that touch fields other than the
label.And I realize that most of the API makes optional params 'false' by default, I'm happy to rename this one to fit that pattern too if requested (e.g.
disableSortByLabel: false).Tested with both 'createQuickPick' and 'showQuickPick' from an extension.