clojure-emacs / clojure-ts-mode

The next generation Clojure major mode for Emacs, powered by TreeSitter
GNU General Public License v3.0
129 stars 11 forks source link

Syntax highlighting problem (?), can someone reproduce this. #24

Closed jasonjckn closed 11 months ago

jasonjckn commented 11 months ago

Expected behavior

image

Actual behavior

image

Steps to reproduce the problem

Hopefully someone can reproduce this easily, if not, just close this issue . My emacs config is pretty complex, so it could be easily something else.

copy and paste this at the top of a large clojure file without any other backticks , and you see syntax color mess up

(defmacro satisfies? [c]
  {:pre [(symbol? c)
         (contains? (eval c) :on)]}
  `[:fn {:error/message (str "should satisfy protocol " (:on ~c))}
    #(clojure.core/satisfies? ~c %)])

Environment & Version information

clojure-ts-mode version

Include here the version string displayed by M-x clojure-ts-mode-display-version. Here's an example:

image

i'm on a fork... maybe that's why. but its very recent.

clojure-ts-mode (version 0.1.5)

tree-sitter-clojure grammar version

E.g. v0.0.12 should be the latest, its rarely updated.

Please make sure you are using compatible tree-sitter grammars. See the variable clojure-ts-grammar-recipes for the current recommend versions. They should be installed automatically if not found. However, some linux distributions package these same grammars and Emacs will use them if found.

If you are not sure what version you are using, try running M-x treesit-install-language-grammar clojure y, and use the values https://github.com/sogaiu/tree-sitter-clojure.git for the URL, v0.0.12 for the TAG and default values for the remaining options. Then see if the problem still persists.

Emacs version

29.1 using the emacs-mac build from https://github.com/railwaycat/homebrew-emacsmacport

Operating system

mac

sogaiu commented 11 months ago

The following is what I get when I put the sample of code at the beginning of clojure's core.clj (with backticks removed):

clojure-ts-mode-issue-24

This is with emacs 29.1 and clojure-ts-mode 8e61fe8f (0.2.0).

dannyfreeman commented 11 months ago

I can't reproduce it either. Have you tried this on the latest v0.2.0 version? If that doesn't work providing a full file that reproduces would be useful.

You could consider running treesit-explore-mode as well to see if there are any errors in the syntax tree (I didn't see any with that macro fwiw)

manuel-uberti commented 11 months ago

FWIW, I cannot reproduce it either.

jasonjckn commented 11 months ago

Thanks everyone, going to close this and take a deeper dive on the weekend, reopen if needed. Sounds like its on my end.