Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
delphinus wants to merge2 commits intomaster
base:master
Choose a base branch
Loading
fromfix/nvim-treesitter-main-branch-compatibility

Conversation

@delphinus
Copy link
Member

Description

The nvim-treesitter main branch removed several APIs that the treesitter picker depended on:

  • parsers.get_buf_lang()
  • parsers.has_parser()
  • nvim-treesitter.locals module

This 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 extraction

The fix maintains backward compatibility with:

  • nvim-treesitter master branch
  • Neovim 0.9.0+

Includes fallback mechanism for languages without locals queries.

Fixes:#3547

🤖 Generated withClaude Code

Type of change

  • Bug fix (non-breaking change which fixes an issue)

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

  • Test A
  • Test B

Configuration:

  • Neovim version (nvim --version):
  • Operating system and version:

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

delphinusand others added2 commitsOctober 27, 2025 18:37
…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>
Copy link
Contributor

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
Copy link
Contributor

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).

Copy link
Contributor

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).

@clason
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

@clasonclason left a 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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@clasonclasonclason requested changes

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Treesitter picker is broken on main branch of nvim-treesitter

3 participants

@delphinus@clason

[8]ページ先頭

©2009-2025 Movatter.jp