Skip to content

Commit 75aa34d

Browse files
committed
Correctly font lock the name symbols of def and defn with meta data
1 parent 026b65d commit 75aa34d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clojure-ts-mode.el

+4-2
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ with the markdown_inline grammar."
371371
;; No wonder the tree-sitter-clojure grammar only touches syntax, and not semantics
372372
:feature 'definition ;; defn and defn like macros
373373
:language 'clojure
374-
`(((list_lit :anchor (sym_lit (sym_name) @def)
374+
`(((list_lit :anchor meta: _ :?
375+
:anchor (sym_lit (sym_name) @def)
375376
:anchor (sym_lit (sym_name) @font-lock-function-name-face))
376377
(:match ,(rx-to-string
377378
`(seq bol
@@ -412,7 +413,8 @@ with the markdown_inline grammar."
412413

413414
:feature 'variable ;; def, defonce
414415
:language 'clojure
415-
`(((list_lit :anchor (sym_lit (sym_name) @def)
416+
`(((list_lit :anchor meta: _ :?
417+
:anchor (sym_lit (sym_name) @def)
416418
:anchor (sym_lit (sym_name) @font-lock-variable-name-face))
417419
(:match ,clojure-ts--variable-definition-symbol-regexp @def)))
418420

0 commit comments

Comments
 (0)