Skip to content

Weird behavior for @block.* in some languages #797

@oiiiiiiii

Description

@oiiiiiiii

Describe the bug
The queries for @block.inner and @block.outer are very unituitive and not all that useful to me, at least for rust and ecma script. As an example: this is selected with @block.inner:

Image

So basically the outer block. Instead I would expect something like that to be selected

Image

To Reproduce
Steps to reproduce the behavior:
Use the @block.* text objects

Expected behavior
The content inside the block is selected for @block.inner or the block itself for @block.outer

Output of :checkhealth nvim-treesitter

N/A

Output of nvim --version

N/A

Additional context
I created a PR here that fixes it in rust and ecma script, if this behavior is noticed in other languages as well I can try and add those as well. For lua it works well, so maybe not a general problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions