Any way to view VSCode "find in files" results organized by folder hierarchy?

Viewed 1095

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:

search results

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?

2 Answers

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.

Search Tree

Shows the search results in a toggle-able tree.

https://user-images.githubusercontent.com/31675041/190530991-7f4b0501-4fc4-4ac6-b383-c248f876c049.png

And

https://user-images.githubusercontent.com/31675041/190531035-cb35e877-cf9c-4832-8acc-71988445d12b.png

Related