vim

2023-06-30T21:22:30.808939Z

Could nvim tree-sitter plugin user confirm that it is matching the missing parenthesis from the string (str ":& dissoc" with the parenthesis of str, causing positioning the cursor on ( of defmethod not highlight it's matching one at the end ?

(defmethod parse-frag "JSXSpreadAttribute" [{:keys [argument] :as step} _state]
  (cond (= (:type argument) "Identifier")
        ;; TODO dissoc attributes
        (str ":& (dissoc " (:name argument)  " :class :className " )
        :else (do
                (js/console.error "Unhandled JSXMemberExpression"
                                  (pr-str step))
               (throw "Unhandled JSXMemberExpression"))))
I'm asking a tree-sitter user, because when I remove the plugin this problematic behaviour does not happen.

dave 2023-06-30T21:33:38.120659Z

I have treesitter installed. Interestingly, it does match the ( in (defmethod correctly:

dave 2023-06-30T21:33:51.087939Z

And highlighting looks fine, as far as I can tell

dave 2023-06-30T21:34:25.682559Z

However, it does get confused by the ( inside of the string. Note that both of these screenshots match the same )

❤️ 1
2023-06-30T21:38:18.210989Z

If you deinstall treesitter, you'll see that while you are inside the string with unbalanced parenthesis it' ll match the ones outside of it, but as soon you move the cursor outside the string, the context ignores parenthesis inside the string, which is the correct behaviour. If you reinstall tree-sitter , it will mix the ones from strings with the ones from clojure syntax

👍 1