Reputation: 343
I'm coming from Eclipse where searching for a string across files using ^h organizes the results by the folder in which they were found, like this:
This is very handy, as folders can be collapsed and expanded to narrow the results. Is there a similar capability (out of the box or via an extension) for vscode?
Upvotes: 19
Views: 3243
Reputation: 1327754
VSCode 1.72 (Sept. 2022) should help, since issue 20224 is now fixed by PR 161022.
There is a new action "View as Tree
" (search.action.viewAsTree
).
This is available in VSCode Insiders today.
Anil reports in the comments:
The settings value is
search.defaultViewMode
. See "Default settings".
// Controls the default search result view mode.
// - tree: Shows search results as a tree.
// - list: Shows search results as a list.
"search.defaultViewMode": "list",
Search Tree
Shows the search results in a toggle-able tree.
And
With PR 173080, VSCode 1.76 (Feb. 2023) introduces an extra state for search tree view collapse, as described in issue 162812.
The default functionality should be the collapse the individual matches and only see the files/folders.
Similar to how multi-root works
Upvotes: 5
Reputation: 732
Now available in the new version of VSCode and can be done by using the new icon on the top of the search panel.
Upvotes: 3
Reputation: 11
Unfortunately no.
It's been 5 years since this feature has been suggested, but with no implementation yet despite the constant bumping of the issue and a lot of upvotes.
https://github.com/microsoft/vscode/issues/20224
Upvotes: 0