@@ -384,9 +384,16 @@ with the markdown_inline grammar."
384384 marker: _ @clojure-ts-keyword-face
385385 delimiter: _ :? @default))
386386
387+ ; ; Highlight as built-in only if there is no namespace or namespace is
388+ ; ; `clojure.core' .
387389 :feature 'builtin
388390 :language 'clojure
389- `(((list_lit meta: _ :? :anchor (sym_lit (sym_name) @font-lock-keyword-face))
391+ `(((list_lit meta: _ :? :anchor (sym_lit !namespace name: (sym_name) @font-lock-keyword-face))
392+ (:match , clojure-ts--builtin-symbol-regexp @font-lock-keyword-face))
393+ ((list_lit meta: _ :? :anchor
394+ (sym_lit namespace: ((sym_ns) @ns
395+ (:equal " clojure.core" @ns))
396+ name: (sym_name) @font-lock-keyword-face))
390397 (:match , clojure-ts--builtin-symbol-regexp @font-lock-keyword-face))
391398 ((sym_name) @font-lock-builtin-face
392399 (:match , clojure-ts--builtin-dynamic-var-regexp @font-lock-builtin-face)))
@@ -408,12 +415,13 @@ with the markdown_inline grammar."
408415 ; ; No wonder the tree-sitter-clojure grammar only touches syntax, and not semantics
409416 :feature 'definition ; ; defn and defn like macros
410417 :language 'clojure
411- `(((list_lit :anchor meta: _ :?
412- :anchor (sym_lit (sym_name) @def )
418+ `(((list_lit :anchor meta: _ :*
419+ :anchor (sym_lit (sym_name) @font-lock-keyword-face )
413420 :anchor (sym_lit (sym_name) @font-lock-function-name-face))
414421 (:match ,(rx-to-string
415422 `(seq bol
416423 (or
424+ " fn"
417425 " defn"
418426 " defn-"
419427 " defmulti"
@@ -423,7 +431,7 @@ with the markdown_inline grammar."
423431 " defmacro"
424432 " definline" )
425433 eol))
426- @def ))
434+ @font-lock-keyword-face ))
427435 ((anon_fn_lit
428436 marker: " #" @font-lock-property-face))
429437 ; ; Methods implementation
@@ -450,10 +458,10 @@ with the markdown_inline grammar."
450458
451459 :feature 'variable ; ; def, defonce
452460 :language 'clojure
453- `(((list_lit :anchor meta: _ :?
454- :anchor (sym_lit (sym_name) @def )
461+ `(((list_lit :anchor meta: _ :*
462+ :anchor (sym_lit (sym_name) @font-lock-keyword-face )
455463 :anchor (sym_lit (sym_name) @font-lock-variable-name-face))
456- (:match , clojure-ts--variable-definition-symbol-regexp @def )))
464+ (:match , clojure-ts--variable-definition-symbol-regexp @font-lock-keyword-face )))
457465
458466 ; ; Can we support declarations in the namespace form?
459467 :feature 'type
@@ -479,10 +487,10 @@ with the markdown_inline grammar."
479487 :override t
480488 `((meta_lit
481489 marker: " ^" @font-lock-operator-face
482- value: (kwd_lit (kwd_name) @font-lock-property-name -face))
490+ value: (kwd_lit (kwd_name) @clojure-ts-keyword -face))
483491 (old_meta_lit
484492 marker: " #^" @font-lock-operator-face
485- value: (kwd_lit (kwd_name) @font-lock-property-name -face)))
493+ value: (kwd_lit (kwd_name) @clojure-ts-keyword -face)))
486494
487495 :feature 'tagged-literals
488496 :language 'clojure
0 commit comments