You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to extend clangd-vscode with an AST search engine besides regex and plain text search, unfortunately it looks like, that VSCode does not support to extend the global and lokal search.
It would be very useful, if one could just add a search engine. Currently we have to add a new separate view, but that is unintentional.
Optionally it would be good to also support a pop-up dialog, with the ability to modify specific search options and a larger search field with semantic linting.
Reacted by Fabian Keßler-Schulz, Tor Shepherd, Caleb Allen, Lennard Sprong, danemtsov, c0nstexpr, Kevin Puetz, drakumus, Brent Brewington, Ryan Bliss and 25 more
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.
For the most part, this API is meant to be consumed to simply search for 'text' as-is. For example, if you create a custom filesystem, this API helps with actually understanding what it takes to get search results from your project. This being said, it was not necessarily created to facilitate a special or 'intelligent' search that requires custom options. The reason why the options have things like isRegex is because the UI (aka the search view on the sidebar) will have a button for that, which will drive what info we send to the API. If we introduced more/alternative options, this would preferably match changes in the UI. We want to keep the options simple, as that is what the user expects out of the search view (for now). Also, we only allow one provider per file scheme, so regular text would lose the traditional ripgrep text results if you overwrote our default provider for text with your own.
Can you reopen this, or explain how your extension will cover this issue?
The thing is, that we don't want to change anything with the current ways of searching.
We want to add a new search type "ast_search", which expects a string of the clang-ast-matcher-dsl. So we definitely need to somehow change the mode to something else than text or regex.
We also would like to change some options, e.g. the Traverse Mode.
A future extension would also be, to provide a rich semantic checking UI, where only valid matchers can be concatenated.
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
Searching across workspace directory in multiple files (AST analogue of ctrl-shift-f)
Finding AST matches in editor (AST analogue of ctrl-f)
Fabian Keßler-Schulz (@Febbe) can you clarify which one hits request is for? I think we could accomplish 1. today by adding a custom TreeView in a sidebar, but there's no good way to do 2. (custom finding within the open file) currently.
If I understand correctly, this request is about a better/cleaner/more fully integrated way of performing 1. ?
Searching across workspace directory in multiple files (AST analogue of ctrl-shift-f)
Finding AST matches in editor (AST analogue of ctrl-f)
Fabian Keßler-Schulz (@Febbe) can you clarify which one hits request is for? I think we could accomplish 1. today by adding a custom TreeView in a sidebar, but there's no good way to do 2. (custom finding within the open file) currently.
If I understand correctly, this request is about a better/cleaner/more fully integrated way of performing 1. ?
Actually both, I believe that both search view bars are implemented similar or even with the same code. So we need in both bars a way to add our button 'AST' just next to regex (will later add some pictures and modify the base post).
Strg+F and STRG+Shift+F should move the focus into the bar and use the current selected search engine (in our case 'AST').
Cool, yep that's exactly what I was hoping for as well. This will need to probably add an LSP extension as well eventually, right?
Yes clangd will need an LSP extension, since it should also serve as a search engine provider. But technically a LS and a search engine may be completely independent.
However this idea in general would be a great improvement to all Language Servers and we could propose it to Microsofts LSP specification as well.
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.
🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.
I did a bit of digging, and it looks like UX-wise there is already precedent for a menu of additional filter features being made available in both the search (multiple files) sidebar widget and the single-editor "Find" boxes. Currently it only appears when a "notebook" editor is open (and hides again if you close the notebook), and presents options for how to search within that notebook:
Regular search sidebar widget:
When a notebook editor is open in any tab:
Regular single-file find box:
Single-file find box when a notebook is open:
E.g. if srgn were a backing search engine (see alexpovel/srgn#157), then that funnel button could be updated to always be present (instead of just when you have a notebook), and it could offer additional options based on the programming languages detected in the project.
Activity
andreamah commentedon Oct 2, 2024
We currently have proposed APIs that cover custom search engines.
See the following:
#59921
#73524
vs-code-engineering commentedon Oct 2, 2024
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.
Happy Coding!
Febbe commentedon Oct 3, 2024
Can you reopen this, or explain how your extension will cover this issue?
The thing is, that we don't want to change anything with the current ways of searching.
We want to add a new search type "ast_search", which expects a string of the clang-ast-matcher-dsl. So we definitely need to somehow change the mode to something else than text or regex.
We also would like to change some options, e.g. the Traverse Mode.
A future extension would also be, to provide a rich semantic checking UI, where only valid matchers can be concatenated.
andreamah commentedon Oct 3, 2024
Okay, I can add this as a feature request candidate for adding new ways of searching to the UI.
vs-code-engineering commentedon Oct 3, 2024
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
torshepherd commentedon Oct 4, 2024
I think to clarify what Fabian Keßler-Schulz (@Febbe) is saying, we actually want to add two things
ctrl-shift-f)ctrl-f)Fabian Keßler-Schulz (@Febbe) can you clarify which one hits request is for? I think we could accomplish 1. today by adding a custom TreeView in a sidebar, but there's no good way to do 2. (custom finding within the open file) currently.
If I understand correctly, this request is about a better/cleaner/more fully integrated way of performing 1. ?
Febbe commentedon Oct 4, 2024
Actually both, I believe that both search view bars are implemented similar or even with the same code. So we need in both bars a way to add our button 'AST' just next to regex (will later add some pictures and modify the base post).
Strg+FandSTRG+Shift+Fshould move the focus into the bar and use the current selected search engine (in our case 'AST').torshepherd commentedon Oct 4, 2024
Cool, yep that's exactly what I was hoping for as well. This will need to probably add an LSP extension as well eventually, right?
Febbe commentedon Oct 4, 2024
Yes clangd will need an LSP extension, since it should also serve as a search engine provider. But technically a LS and a search engine may be completely independent.
However this idea in general would be a great improvement to all Language Servers and we could propose it to Microsofts LSP specification as well.
bbrewington commentedon Oct 29, 2024
This Rust-powered tree-sitter based search tool might be good to consider: https://github.com/alexpovel/srgn
I'm going to drop a feature request issue in that repo for VS Code Extension, but thought I'd leave this note as well
vs-code-engineering commentedon Nov 23, 2024
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
vs-code-engineering commentedon Dec 4, 2024
🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
vergenzt commentedon Feb 23, 2026
I did a bit of digging, and it looks like UX-wise there is already precedent for a menu of additional filter features being made available in both the search (multiple files) sidebar widget and the single-editor "Find" boxes. Currently it only appears when a "notebook" editor is open (and hides again if you close the notebook), and presents options for how to search within that notebook:
Regular search sidebar widget:

When a notebook editor is open in any tab:

Regular single-file find box:

Single-file find box when a notebook is open:

E.g. if
srgnwere a backing search engine (see alexpovel/srgn#157), then that funnel button could be updated to always be present (instead of just when you have a notebook), and it could offer additional options based on the programming languages detected in the project.Febbe commentedon Aug 3, 2026
Andrea Mah (@andreamah) do you know, what's the status of this?