From 35ac6b94548239544cea9bf83b2d256b768ca57b Mon Sep 17 00:00:00 2001 From: Jackson Kearl Date: Wed, 6 May 2020 12:03:41 -0700 Subject: [PATCH] Aria label search tree based on contents Closes #95861. --- src/vs/workbench/contrib/search/browser/searchView.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts index c3507839f12..543ad701953 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -1022,6 +1022,7 @@ export class SearchView extends ViewPane { } this.viewModel.cancelSearch(); this.updateActions(); + this.tree.ariaLabel = nls.localize('emptySearch', "Empty Search"); aria.status(nls.localize('ariaSearchResultsClearStatus', "The search results have been cleared")); } @@ -1557,9 +1558,12 @@ export class SearchView extends ViewPane { this.hasSearchResultsKey.set(fileCount > 0); const msgWasHidden = this.messagesElement.style.display === 'none'; + + const messageEl = this.clearMessage(); + let resultMsg = this.buildResultCountMessage(this.viewModel.searchResult.count(), fileCount); + this.tree.ariaLabel = resultMsg + nls.localize('forTerm', " - Search: {0}", this.searchResult.query?.contentPattern.pattern ?? ''); + if (fileCount > 0) { - const messageEl = this.clearMessage(); - let resultMsg = this.buildResultCountMessage(this.viewModel.searchResult.count(), fileCount); if (disregardExcludesAndIgnores) { resultMsg += nls.localize('useIgnoresAndExcludesDisabled', " - exclude settings and ignore files are disabled"); }