Fork me on GitHub
#tree-sitter
<
2022-12-06
>
lispers-anonymous13:12:21

Wow, I was thinking about creating a tree-sitter channel but it turns out there already is one.

lispers-anonymous13:12:03

I am working on this issue in clojure-mode: https://github.com/clojure-emacs/clojure-mode/issues/640 And figured this would be a great place to chat about it and post updates on my progress instead of spamming the clojure mode issue

lispers-anonymous14:12:01

So far: I recently got distinct highlighting on the namespace and name parts of keywords and symbols. I'm now trying to get distinct highlighting for typehints and metadata sugar like this ^:added-metadata

lispers-anonymous18:12:35

Metadata syntax highlighting is working great now. I can pretty easily apply type face to typehints, property face to metadata. I've added preprocessor face to reader tags, comment-delimiter face to the discard tag, warning face to deref symbol. Quote syntax ``~@` and var quotes #' have a delimiter face.

lispers-anonymous19:12:20

Turning off rainbow delimiters, brackets and the set literal # have a delimiter face. edit: did not mean to sent this to channel.

Cora (she/her)00:12:56

do you know how this might interact with lap's highlighting?

lispers-anonymous02:12:47

Do you mean lsp's highlighting? I can't imagine it will be different from how it works today, since I think lsp applies highlighting after the major mode does. I haven't done much testing, but with eglot and clojure-lsp it still does things like highlight matching symbols when the cursor is over it.

Cora (she/her)02:12:59

right, that's my understanding, it enhances the major mode's highlighting, but I was curious if tree-sitter changes that at all

Cora (she/her)02:12:56

I've also wondered as a pie-in-the-sky thing if tree-sitter couldn't be integrated into clojure-lsp but that's not super relevant here

lispers-anonymous12:12:18

Well I can say for sure that eglot with clojure-lsp work well with my tree-sitter branch. I can imagine lsp-mode will as well, but I don't use that library personally. I'm not sure what clojure-lsp would gain by using tree-sitter. I believe it already uses rewrite-clj to fill a similar role as what tree-sitter would do. Maybe it would be faster to parse, but I'm not sure what else it brings to the table. The lsp maintainers might be interested though