Subject: Re: bug#62086: 29.0.60; ruby-ts-mode regressions

From: Juri Linkov <[email-masked]>
Date: Wed, 05 Apr 2023 19:25:46 +0300

> There is no mechanism for precedence in the current implementation. We can
> try ignoring the implicit parens in the parenless method calls,
> though. Like this:

I don't know how many users might still want to skip implicit parens.
Maybe this could be customizable with another list that by default
includes "argument_list".  It's nice that it's doable with the
current treesit features.

> +(defun ruby-ts--sexp-p (node)
> +  ;; Skip parenless calls (implicit parens are both non-obvious to the
> +  ;; user, and might take over when we want to just over some physical
> +  ;; parens/braces).
> +  (or (not (equal (treesit-node-type node)
> +                  "argument_list"))
> +      (equal (treesit-node-type (treesit-node-child node 0))
> +             "(")))

Maybe something similar could be used to detect '[' in 'h[:key]'
to match the corresponding ']'.