alert SR users of tree find result count (#225264)

This commit is contained in:
Megan Rogge 2024-08-09 09:52:52 -07:00 committed by GitHub
parent 297cd2325d
commit 92feede427
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,6 +36,7 @@ import { localize } from 'vs/nls';
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
import { createInstantHoverDelegate, getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
import { autorun, constObservable } from 'vs/base/common/observable';
import { alert } from 'vs/base/browser/ui/aria/aria';
class TreeElementsDragAndDropData<T, TFilterData, TContext> extends ElementsDragAndDropData<T, TContext> {
@ -1144,6 +1145,7 @@ class FindController<T, TFilterData> implements IDisposable {
const noMatches = this.filter.totalCount > 0 && this.filter.matchCount === 0;
if (this.pattern && noMatches) {
alert(localize('replFindNoResults', "No results"));
if (this.tree.options.showNotFoundMessage ?? true) {
this.widget?.showMessage({ type: MessageType.WARNING, content: localize('not found', "No elements found.") });
} else {
@ -1151,6 +1153,9 @@ class FindController<T, TFilterData> implements IDisposable {
}
} else {
this.widget?.clearMessage();
if (this.pattern) {
alert(localize('replFindResults', "{0} results", this.filter.matchCount));
}
}
}