diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts index 9604683c0950f..d5a0919045a2b 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -1007,8 +1007,9 @@ export class SearchView extends ViewPane { const viewer = this.getControl(); const navigator = viewer.navigate(); let node = navigator.first(); + const shouldShowAI = this.shouldShowAIResults(); do { - if (node && !viewer.isCollapsed(node) && (this.shouldShowAIResults() && !(node instanceof TextSearchResult))) { + if (node && !viewer.isCollapsed(node) && (!shouldShowAI || !(node instanceof TextSearchResult))) { // ignore the ai text search result id return true; }