mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
fix Settings editor search result count (#178842)
fix search result count
This commit is contained in:
parent
b34c6339b5
commit
1859288ca7
|
@ -1591,7 +1591,7 @@ export class SettingsEditor2 extends EditorPane {
|
|||
}
|
||||
|
||||
if (this.tocTreeModel && this.tocTreeModel.settingsTreeRoot) {
|
||||
const count = this.tocTreeModel.settingsTreeRoot.count;
|
||||
const count = this.searchResultModel.getUniqueResultsCount();
|
||||
let resultString: string;
|
||||
switch (count) {
|
||||
case 0: resultString = localize('noResults', "No Settings Found"); break;
|
||||
|
|
|
@ -853,6 +853,13 @@ export class SearchResultModel extends SettingsTreeModel {
|
|||
return this.rawSearchResults || [];
|
||||
}
|
||||
|
||||
getUniqueResultsCount(): number {
|
||||
const uniqueResults = this.getUniqueResults();
|
||||
const localResultsCount = uniqueResults[0]?.filterMatches.length ?? 0;
|
||||
const remoteResultsCount = uniqueResults[1]?.filterMatches.length ?? 0;
|
||||
return localResultsCount + remoteResultsCount;
|
||||
}
|
||||
|
||||
setResult(order: SearchResultIdx, result: ISearchResult | null): void {
|
||||
this.cachedUniqueSearchResults = null;
|
||||
this.newExtensionSearchResults = null;
|
||||
|
|
Loading…
Reference in a new issue