@@ -345,6 +345,7 @@ if a third argument (the value) is provided.
345
345
(treesit-range-rules
346
346
:embed 'markdown-inline
347
347
:host 'clojure
348
+ :local t
348
349
(clojure-ts--docstring-query '@capture )))
349
350
350
351
(defun clojure-ts--font-lock-settings (markdown-available )
@@ -1230,7 +1231,7 @@ It is simply `clojure-ts-docstring-fill-prefix-width' number of spaces."
1230
1231
(defun clojure-ts--fill-paragraph (&optional justify )
1231
1232
" Like `fill-paragraph' , but can handler Clojure docstrings.
1232
1233
If JUSTIFY is non-nil, justify as well as fill the paragraph."
1233
- (let ((current-node (treesit-node-at (point ))))
1234
+ (let ((current-node (treesit-node-at (point ) 'clojure )))
1234
1235
(if (clojure-ts--match-docstring nil current-node nil )
1235
1236
(let ((fill-column (or clojure-ts-docstring-fill-column fill-column))
1236
1237
(fill-prefix (clojure-ts--docstring-fill-prefix))
@@ -1260,11 +1261,20 @@ If JUSTIFY is non-nil, justify as well as fill the paragraph."
1260
1261
" map_lit" " ns_map_lit" " vec_lit" " set_lit" )
1261
1262
" A regular expression that matches nodes that can be treated as lists." )
1262
1263
1264
+ (defconst clojure-ts--markdown-inline-sexp-nodes
1265
+ '(" inline_link" " full_reference_link" " collapsed_reference_link"
1266
+ " uri_autolink" " email_autolink" " shortcut_link" " image"
1267
+ " code_span" )
1268
+ " Nodes representing s-expressions in the `markdown-inline' parser." )
1269
+
1263
1270
(defconst clojure-ts--thing-settings
1264
1271
`((clojure
1265
1272
(sexp ,(regexp-opt clojure-ts--sexp-nodes))
1266
1273
(list ,(regexp-opt clojure-ts--list-nodes))
1267
- (text ,(regexp-opt '(" comment" ))))))
1274
+ (text ,(regexp-opt '(" comment" ))))
1275
+ (when clojure-ts-use-markdown-inline
1276
+ (markdown-inline
1277
+ (sexp ,(regexp-opt clojure-ts--markdown-inline-sexp-nodes))))))
1268
1278
1269
1279
(defvar clojure-ts-mode-map
1270
1280
(let ((map (make-sparse-keymap )))
@@ -1380,7 +1390,6 @@ See `clojure-ts--font-lock-settings' for usage of MARKDOWN-AVAILABLE."
1380
1390
(let ((use-markdown-inline (and clojure-ts-use-markdown-inline
1381
1391
(treesit-ready-p 'markdown-inline t ))))
1382
1392
(when use-markdown-inline
1383
- (treesit-parser-create 'markdown-inline )
1384
1393
(setq-local treesit-range-settings clojure-ts--treesit-range-settings))
1385
1394
1386
1395
(when (treesit-ready-p 'clojure )
0 commit comments