mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-25 17:57:50 +01:00
Merge pull request #242114 from microsoft/osortega/fix-expanding-ai-search-tree
Fix for automatically expanding AI search tree
This commit is contained in:
@@ -24,6 +24,7 @@ import { category, getElementsToOperateOn, getSearchView, shouldRefocus } from '
|
||||
import { equals } from '../../../../base/common/arrays.js';
|
||||
import { arrayContainsElementOrParent, RenderableMatch, ISearchResult, isSearchTreeFileMatch, isSearchTreeFolderMatch, isSearchTreeMatch, isSearchResult, isTextSearchHeading } from './searchTreeModel/searchTreeCommon.js';
|
||||
import { MatchInNotebook } from './notebookSearch/notebookSearchModel.js';
|
||||
import { AITextSearchHeadingImpl } from './AISearch/aiSearchModel.js';
|
||||
|
||||
|
||||
//#region Interfaces
|
||||
@@ -375,10 +376,18 @@ export async function getElementToFocusAfterRemoved(viewer: WorkbenchCompressibl
|
||||
while (!!navigator.next() && (!isSearchTreeFolderMatch(navigator.current()) || arrayContainsElementOrParent(navigator.current(), elementsToRemove))) { }
|
||||
} else if (isSearchTreeFileMatch(element)) {
|
||||
while (!!navigator.next() && (!isSearchTreeFileMatch(navigator.current()) || arrayContainsElementOrParent(navigator.current(), elementsToRemove))) {
|
||||
// Never expand AI search results by default
|
||||
if (navigator.current() instanceof AITextSearchHeadingImpl) {
|
||||
return navigator.current();
|
||||
}
|
||||
await viewer.expand(navigator.current());
|
||||
}
|
||||
} else {
|
||||
while (navigator.next() && (!isSearchTreeMatch(navigator.current()) || arrayContainsElementOrParent(navigator.current(), elementsToRemove))) {
|
||||
// Never expand AI search results by default
|
||||
if (navigator.current() instanceof AITextSearchHeadingImpl) {
|
||||
return navigator.current();
|
||||
}
|
||||
await viewer.expand(navigator.current());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user