cursorless-dev / cursorless

Don't let the cursor slow you down
https://www.cursorless.org/
MIT License
1.14k stars 80 forks source link

Tracker: unmitigated issues in tree-sitter-kotlin #2642

Closed wolfmanstout closed 2 weeks ago

wolfmanstout commented 2 months ago

This issue will track upstream bugs in tree-sitter-kotlin that are not mitigated in the Cursorless scope queries.

AndreasArvidsson commented 2 months ago

May I ask in what scenario you need to match on null? On top of my head I can't think of any language where we do that.

wolfmanstout commented 2 months ago

May I ask in what scenario you need to match on null? On top of my head I can't think of any language where we do that.

I don't plan to explicitly match on null, I simply need (_) to match null in addition to everything else. Right now null doesn't generate any node in the parse tree at all and can only be matched with an explicit "null". Hence it breaks for various scopes (I bumped into it when attempting to refer to the "value" of an argument that was null).

wolfmanstout commented 2 months ago

Also I probably should have mentioned that I filed this tracking bug per pokey's request.

AndreasArvidsson commented 2 months ago

If you want to match on both named and unnamed nodes you can just use _. That should also match on "null". (_) on the other hand only matches on named nodes. Could you get by with something like: value: _ @value?

wolfmanstout commented 2 months ago

That would likely cause trouble to use everywhere I use (_), because it would also match syntactic elements like braces. And it would need to be everywhere I use an expression, not just value.

There are pull requests already out for both these bugs.

wolfmanstout commented 2 months ago

@AndreasArvidsson these issues are now both fixed upstream. Shall I create a PR to bump the Kotlin tree sitter version? I ask only because pokey wanted to do this himself last time I sent a similar PR.

AndreasArvidsson commented 1 month ago

Ideally yes, but I don't think the parse tree extension deploys automatically and only Pokey knows how to do that manually.

pokey commented 2 weeks ago

ok tree-sitter-kotlin is now bumped. @wolfmanstout feel free to close if everything is now working as expected