@@ -371,18 +371,22 @@ Only intended for use at development time.")
371371 " Return a regular expression that matches one of SYMBOLS exactly."
372372 (concat " ^" (regexp-opt symbols) " $" ))
373373
374- (defvar clojure-ts-function-docstring-symbols
375- '(" definline"
376- " defmulti"
377- " defmacro"
378- " defn"
379- " defn-"
380- " defprotocol"
381- " ns" )
374+ (defconst clojure-ts-function-docstring-symbols
375+ (eval-and-compile
376+ (rx line-start
377+ (or " definline"
378+ " defmulti"
379+ " defmacro"
380+ " defn"
381+ " defn-"
382+ " defprotocol"
383+ " ns" )
384+ line-end))
382385 " Symbols that accept an optional docstring as their second argument." )
383386
384- (defvar clojure-ts-definition-docstring-symbols
385- '(" def" )
387+ (defconst clojure-ts-definition-docstring-symbols
388+ (eval-and-compile
389+ (rx line-start " def" line-end))
386390 " Symbols that accept an optional docstring as their second argument.
387391Any symbols added here should only treat their second argument as a docstring
388392if a third argument (the value) is provided.
@@ -428,7 +432,7 @@ if a third argument (the value) is provided.
428432 :anchor (str_lit (str_content) , capture-symbol ) @font-lock-doc-face
429433 ; ; The variable's value
430434 :anchor (_))
431- (:match ,( clojure-ts-symbol-regexp clojure-ts- definition-docstring-symbols)
435+ (:match , clojure-ts-definition-docstring-symbols
432436 @_def_symbol))
433437 ; ; Captures docstrings in metadata of definitions
434438 ((list_lit :anchor [(comment) (meta_lit) (old_meta_lit)] :*
@@ -456,7 +460,7 @@ if a third argument (the value) is provided.
456460 :anchor (sym_lit)
457461 :anchor [(comment) (meta_lit) (old_meta_lit)] :*
458462 :anchor (str_lit (str_content) , capture-symbol ) @font-lock-doc-face)
459- (:match ,( clojure-ts-symbol-regexp clojure-ts- function-docstring-symbols)
463+ (:match , clojure-ts-function-docstring-symbols
460464 @_def_symbol))
461465 ; ; Captures docstrings in defprotcol, definterface
462466 ((list_lit :anchor [(comment) (meta_lit) (old_meta_lit)] :*
@@ -1498,7 +1502,15 @@ function literal."
14981502 " definline"
14991503 " defrecord"
15001504 " defmacro"
1501- " defmulti" )
1505+ " defmulti"
1506+ " defonce"
1507+ " defprotocol"
1508+ " deftest"
1509+ " deftest-"
1510+ " ns"
1511+ " definterface"
1512+ " deftype"
1513+ " defstruct" )
15021514 eol)))
15031515
15041516(defconst clojure-ts--markdown-inline-sexp-nodes
@@ -1509,7 +1521,7 @@ function literal."
15091521
15101522(defun clojure-ts--default-sexp-node-p (node )
15111523 " Return TRUE if point is after the # marker of set or function literal NODE."
1512- (and (eq (char-before ( point ) ) ?\# )
1524+ (and (eq (char-before ) ?\# )
15131525 (string-match-p (rx bol (or " anon_fn_lit" " set_lit" ) eol)
15141526 (treesit-node-type (treesit-node-parent node)))))
15151527
0 commit comments