@@ -260,7 +260,8 @@ if a third argument (the value) is provided.
260260(defun clojure-ts--docstring-query (capture-symbol )
261261 " Return a query that captures docstrings with CAPTURE-SYMBOL."
262262 `(; ; Captures docstrings in def
263- ((list_lit :anchor (sym_lit) @_def_symbol
263+ ((list_lit :anchor (meta_lit) :?
264+ :anchor (sym_lit) @_def_symbol
264265 :anchor (comment) :?
265266 :anchor (sym_lit) ; variable name
266267 :anchor (comment) :?
@@ -288,7 +289,8 @@ if a third argument (the value) is provided.
288289 @_def_symbol)
289290 (:equal @_doc-keyword " :doc" ))
290291 ; ; Captures docstrings defn, defmacro, ns, and things like that
291- ((list_lit :anchor (sym_lit) @_def_symbol
292+ ((list_lit :anchor (meta_lit) :?
293+ :anchor (sym_lit) @_def_symbol
292294 :anchor (comment) :?
293295 :anchor (sym_lit) ; function_name
294296 :anchor (comment) :?
@@ -347,7 +349,7 @@ with the markdown_inline grammar."
347349
348350 :feature 'builtin
349351 :language 'clojure
350- `(((list_lit :anchor (sym_lit (sym_name) @font-lock-keyword-face))
352+ `(((list_lit meta: _ :? :anchor (sym_lit (sym_name) @font-lock-keyword-face))
351353 (:match , clojure-ts--builtin-symbol-regexp @font-lock-keyword-face))
352354 ((sym_name) @font-lock-builtin-face
353355 (:match , clojure-ts--builtin-dynamic-var-regexp @font-lock-builtin-face)))
@@ -369,7 +371,8 @@ with the markdown_inline grammar."
369371 ; ; No wonder the tree-sitter-clojure grammar only touches syntax, and not semantics
370372 :feature 'definition ; ; defn and defn like macros
371373 :language 'clojure
372- `(((list_lit :anchor (sym_lit (sym_name) @def)
374+ `(((list_lit :anchor meta: _ :?
375+ :anchor (sym_lit (sym_name) @def)
373376 :anchor (sym_lit (sym_name) @font-lock-function-name-face))
374377 (:match ,(rx-to-string
375378 `(seq bol
@@ -410,7 +413,8 @@ with the markdown_inline grammar."
410413
411414 :feature 'variable ; ; def, defonce
412415 :language 'clojure
413- `(((list_lit :anchor (sym_lit (sym_name) @def)
416+ `(((list_lit :anchor meta: _ :?
417+ :anchor (sym_lit (sym_name) @def)
414418 :anchor (sym_lit (sym_name) @font-lock-variable-name-face))
415419 (:match , clojure-ts--variable-definition-symbol-regexp @def)))
416420
0 commit comments