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

Allow to provide custom query for get_captures_at_position and get_captures_at_cursor #20136

Open
stasjok opened this issue Sep 9, 2022 · 1 comment
Labels
Milestone

Comments

@stasjok
Copy link
Contributor

stasjok commented Sep 9, 2022

Feature already in Vim?

No response

Feature description

get_captures_at_position and get_captures_at_cursor functions are added in #20093. It looks like they can return only captures from highlighter. It would be useful to allow specifying custom query for cases where simple get_node_at_cursor is not enough. In this case I write a custom query for e.g. conditions what snippets can be expanded here, conditions for auto-pairs etc.

@stasjok stasjok added the enhancement feature request label Sep 9, 2022
@clason
Copy link
Member

clason commented Sep 9, 2022

Yes, (only) that is their intended use case, as this is the only treesitter functionality provided by Neovim itself at the moment.

More complicated use cases are probably still better served by https://github.com/nvim-treesitter/playground.

@clason clason added this to the unplanned milestone Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants