Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Treesitter Symbol Search #1447

Open
1 task done
scienceplease opened this issue Sep 16, 2024 · 2 comments
Open
1 task done

Feature: Treesitter Symbol Search #1447

scienceplease opened this issue Sep 16, 2024 · 2 comments
Labels
feature request New feature

Comments

@scienceplease
Copy link

Have you RTFM'd?

  • I have done proper research

Feature Request

Enable searching treesitter symbols akin to Telescope's builtin.treesitter.

Notionally, ts_symbols could search all buffer symbols, while ts_functions, ts_variables, ts_classes, etc. could be defined to search a specific subset of symbols. Alternatively (or additionally), ts_symbols could accept a criteria to filter on particular symbol types.

@scienceplease scienceplease added the feature request New feature label Sep 16, 2024
@ibhagwan
Copy link
Owner

I’ve seen this in Telescope but I’m not sure I find the value in this, in between lsp symbols and btags/blinds I can’t think of anything I would like to find in a file and can’t or would a scenario where I’d prefer to open a tree sitter picker instead.

What’s the use case for this that isn’t covered by the pickers I mentioned?

@scienceplease
Copy link
Author

scienceplease commented Sep 16, 2024

Searching across LSP symbols is absolutely better as you say, but it is often the case that languages/syntaxes have treesitter grammars but no LSP. Sometimes project files/structure can be too large for certain LSPs, in which case only Treesitter can be used.

Being able to search across tokens with certain semantics is helpful for the same reason lsp_typedefs, lsp_implementations, etc. are helpful. To your point, regular string search can get you to the same place but search results can be quite cluttered without pre-filtering (depending on the structure and amount of code).

Telescope pickers can be used alongside fzf-lua to search treesitter symbols, it just depends on how you want to position fzf-lua. Would you expect users to have both fzf-lua and telescope installed and configured? Personally, I would just use one or the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature
Projects
None yet
Development

No branches or pull requests

2 participants