@@ -260,7 +260,8 @@ if a third argument (the value) is provided.
260
260
(defun clojure-ts--docstring-query (capture-symbol )
261
261
" Return a query that captures docstrings with CAPTURE-SYMBOL."
262
262
`(; ; Captures docstrings in def
263
- ((list_lit :anchor (sym_lit) @_def_symbol
263
+ ((list_lit :anchor (meta_lit) :?
264
+ :anchor (sym_lit) @_def_symbol
264
265
:anchor (comment) :?
265
266
:anchor (sym_lit) ; variable name
266
267
:anchor (comment) :?
@@ -288,7 +289,8 @@ if a third argument (the value) is provided.
288
289
@_def_symbol)
289
290
(:equal @_doc-keyword " :doc" ))
290
291
; ; 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
292
294
:anchor (comment) :?
293
295
:anchor (sym_lit) ; function_name
294
296
:anchor (comment) :?
@@ -347,7 +349,7 @@ with the markdown_inline grammar."
347
349
348
350
:feature 'builtin
349
351
: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))
351
353
(:match , clojure-ts--builtin-symbol-regexp @font-lock-keyword-face))
352
354
((sym_name) @font-lock-builtin-face
353
355
(:match , clojure-ts--builtin-dynamic-var-regexp @font-lock-builtin-face)))
@@ -369,7 +371,8 @@ with the markdown_inline grammar."
369
371
; ; No wonder the tree-sitter-clojure grammar only touches syntax, and not semantics
370
372
:feature 'definition ; ; defn and defn like macros
371
373
:language 'clojure
372
- `(((list_lit :anchor (sym_lit (sym_name) @def)
374
+ `(((list_lit :anchor meta: _ :?
375
+ :anchor (sym_lit (sym_name) @def)
373
376
:anchor (sym_lit (sym_name) @font-lock-function-name-face))
374
377
(:match ,(rx-to-string
375
378
`(seq bol
@@ -410,7 +413,8 @@ with the markdown_inline grammar."
410
413
411
414
:feature 'variable ; ; def, defonce
412
415
:language 'clojure
413
- `(((list_lit :anchor (sym_lit (sym_name) @def)
416
+ `(((list_lit :anchor meta: _ :?
417
+ :anchor (sym_lit (sym_name) @def)
414
418
:anchor (sym_lit (sym_name) @font-lock-variable-name-face))
415
419
(:match , clojure-ts--variable-definition-symbol-regexp @def)))
416
420
0 commit comments