未验证 提交 ccd33c15 编写于 作者: J Jean Pierre 提交者: GitHub

Fixes quick find symbol finder shows 'no matching results' after backspace (#101844)

* Fixes #101708

* small polish
Co-authored-by: NBenjamin Pasero <benjpas@microsoft.com>
上级 2e802ebc
......@@ -67,6 +67,10 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
static PREFIX = '';
private static readonly NO_RESULTS_PICK: IAnythingQuickPickItem = {
label: localize('noAnythingResults', "No matching results")
};
private static readonly MAX_RESULTS = 512;
private static readonly TYPING_SEARCH_DELAY = 200; // this delay accommodates for the user typing a word and then stops typing to start searching
......@@ -173,9 +177,7 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
) {
super(AnythingQuickAccessProvider.PREFIX, {
canAcceptInBackground: true,
noResultsPick: {
label: localize('noAnythingResults', "No matching results")
}
noResultsPick: AnythingQuickAccessProvider.NO_RESULTS_PICK
});
}
......@@ -278,13 +280,15 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
this.pickState.lastFilter = filter;
// Remember our pick state before returning new picks
// unless an editor symbol is selected. We can use this
// state to return back to the global pick when the
// user is narrowing back out of editor symbols.
// unless we are inside an editor symbol filter or result.
// We can use this state to return back to the global pick
// when the user is narrowing back out of editor symbols.
const picks = this.pickState.picker?.items;
const activePick = this.pickState.picker?.activeItems[0];
if (picks && activePick) {
if (!isEditorSymbolQuickPickItem(activePick)) {
const activePickIsEditorSymbol = isEditorSymbolQuickPickItem(activePick);
const activePickIsNoResultsInEditorSymbols = activePick === AnythingQuickAccessProvider.NO_RESULTS_PICK && filter.indexOf(GotoSymbolQuickAccessProvider.PREFIX) >= 0;
if (!activePickIsEditorSymbol && !activePickIsNoResultsInEditorSymbols) {
this.pickState.lastGlobalPicks = {
items: picks,
active: activePick
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册