Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork922
fix(builtin): make treesitter picker compatible with nvim-treesitter …#3548
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Conversation
…main branchThe nvim-treesitter main branch removed several APIs that the treesitterpicker depended on:- parsers.get_buf_lang()- parsers.has_parser()- nvim-treesitter.locals moduleThis commit replaces these with Neovim's built-in treesitter APIs:- vim.treesitter.language.get_lang() for language detection- utils.has_ts_parser() for parser existence checking- vim.treesitter.query.get() for symbol extractionThe fix maintains backward compatibility with:- nvim-treesitter master branch- Neovim 0.9.0+Includes fallback mechanism for languages without locals queries.Fixes:#3547🤖 Generated with [Claude Code](https://claude.com/claude-code)Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unused prepare_match function- Remove unused metadata variable from iter_captures loop- Apply stylua formatting (parentheses removal, line breaks)🤖 Generated with [Claude Code](https://claude.com/claude-code)Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think this is excessive. Donot add AI slop to the repo for every minor fix!
| table.insert(results,entry) | ||
| ifquerythen | ||
| -- Use locals query to find definitions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Themain branch has alocals API; normally I discourage plugins relying on nvim-treesitter directly, but in this case it would be good to exercise (and the module may be upstreamed in the future).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oops, forgot I removed it since it was unused (and untested). You may go git log spelunking to find thelocals.lua and extract it for use here (it's a stand-alone file).
I think it's time to drop support for 0.9. Even Debian now ships with 0.10.4! |
| end | ||
| end | ||
| else | ||
| -- Fallback: use basic node types as symbols |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is a separate feature and should be a separate PR; let's keep this one to the minimal(!) fix needed to not error onmain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There's too many changes in this; needs to be a minimal(!) fix.
Description
The nvim-treesitter main branch removed several APIs that the treesitter picker depended on:
This commit replaces these with Neovim's built-in treesitter APIs:
The fix maintains backward compatibility with:
Includes fallback mechanism for languages without locals queries.
Fixes:#3547
🤖 Generated withClaude Code
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list relevant details about your configuration
Configuration:
Checklist: