Add optional sortByLabel to QuickPick to control whether to re-sort items when query changes

Summary:
Address issue #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.

https://github.com/microsoft/vscode/issues/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
This commit is contained in:
Peter Elmers
2019-07-12 09:41:27 -07:00
committed by Christof Marti
parent 8efa538d7d
commit e9c0aeb8b0
6 changed files with 46 additions and 1 deletions

View File

@@ -475,6 +475,8 @@ export interface TransferQuickPick extends BaseTransferQuickInput {
matchOnDescription?: boolean;
sortByLabel?: boolean;
matchOnDetail?: boolean;
}