@@ -343,14 +343,14 @@ if a third argument (the value) is provided.
343343
344344(defvar clojure-ts--treesit-range-settings
345345 (treesit-range-rules
346- :embed 'markdown_inline
346+ :embed 'markdown-inline
347347 :host 'clojure
348348 (clojure-ts--docstring-query '@capture )))
349349
350350(defun clojure-ts--font-lock-settings (markdown-available )
351351 " Return font lock settings suitable for use in `treesit-font-lock-settings' .
352352When MARKDOWN-AVAILABLE is non-nil, includes rules for highlighting docstrings
353- with the markdown_inline grammar."
353+ with the markdown-inline grammar."
354354 (append
355355 (treesit-font-lock-rules
356356 :feature 'string
@@ -512,11 +512,9 @@ with the markdown_inline grammar."
512512 (when markdown-available
513513 (treesit-font-lock-rules
514514 :feature 'doc
515- :language 'markdown_inline
515+ :language 'markdown-inline
516516 :override t
517- `((inline
518- (code_span (code_span_delimiter) :* @font-lock-delimiter-face)
519- @font-lock-constant-face))))
517+ `((code_span) @font-lock-constant-face)))
520518
521519 (treesit-font-lock-rules
522520 :feature 'quote
@@ -985,7 +983,7 @@ and (:defn) is converted to (:inner 1)."
985983 (t nil ))))
986984
987985(defun clojure-ts--dynamic-indent-for-symbol (sym &optional ns )
988- " Returns the dynamic indentation specification for SYM, if found.
986+ " Return the dynamic indentation specification for SYM, if found.
989987
990988If the function `clojure-ts-get-indent-function' is defined, call it and
991989produce a valid indentation specification from its return value.
@@ -1019,7 +1017,7 @@ If NS is defined, then the fully qualified symbol is passed to
10191017 (equal (car spec1) :block )))))))))
10201018
10211019(defun clojure-ts--find-semantic-rule (node parent current-depth )
1022- " Returns a suitable indentation rule for NODE, considering the CURRENT-DEPTH.
1020+ " Return a suitable indentation rule for NODE, considering the CURRENT-DEPTH.
10231021
10241022Attempts to find an indentation rule by examining the symbol name of the
10251023PARENT's first child. If a rule is not found, it navigates up the
@@ -1167,7 +1165,7 @@ hints."
11671165 (treesit-node-start parent))))
11681166
11691167(defun clojure-ts--match-collection-item-with-metadata (node-type )
1170- " Returns a matcher for a collection item with metadata by NODE-TYPE.
1168+ " Return a matcher for a collection item with metadata by NODE-TYPE.
11711169
11721170The returned matcher accepts NODE, PARENT and BOL and returns true only
11731171if NODE has metadata and its parent has type NODE-TYPE."
@@ -1296,9 +1294,9 @@ If JUSTIFY is non-nil, justify as well as fill the paragraph."
12961294
12971295(defconst clojure-ts-grammar-recipes
12981296 '((clojure " https://github.com/sogaiu/tree-sitter-clojure.git"
1299- " v0.0.12 " )
1300- (markdown_inline " https://github.com/MDeiml/tree-sitter-markdown"
1301- " v0.1.6 "
1297+ " v0.0.13 " )
1298+ (markdown-inline " https://github.com/MDeiml/tree-sitter-markdown"
1299+ " v0.4.1 "
13021300 " tree-sitter-markdown-inline/src" ))
13031301 " Intended to be used as the value for `treesit-language-source-alist' ." )
13041302
@@ -1316,6 +1314,18 @@ If JUSTIFY is non-nil, justify as well as fill the paragraph."
13161314 (let ((treesit-language-source-alist clojure-ts-grammar-recipes))
13171315 (treesit-install-language-grammar grammar)))))))
13181316
1317+ (defun clojure-ts-reinstall-grammars ()
1318+ " Install the required versions of language grammars.
1319+
1320+ If the grammars are already installed, they will be reinstalled. This
1321+ function can also be used to upgrade the grammars if they are outdated."
1322+ (interactive )
1323+ (dolist (recipe clojure-ts-grammar-recipes)
1324+ (let ((grammar (car recipe)))
1325+ (message " Installing %s tree-sitter grammar " grammar)
1326+ (let ((treesit-language-source-alist clojure-ts-grammar-recipes))
1327+ (treesit-install-language-grammar grammar)))))
1328+
13191329(defun clojure-ts-mode-variables (&optional markdown-available )
13201330 " Initialize buffer-local variables for `clojure-ts-mode' .
13211331See `clojure-ts--font-lock-settings' for usage of MARKDOWN-AVAILABLE."
@@ -1361,9 +1371,9 @@ See `clojure-ts--font-lock-settings' for usage of MARKDOWN-AVAILABLE."
13611371 :syntax-table clojure-ts-mode-syntax-table
13621372 (clojure-ts--ensure-grammars)
13631373 (let ((use-markdown-inline (and clojure-ts-use-markdown-inline
1364- (treesit-ready-p 'markdown_inline t ))))
1374+ (treesit-ready-p 'markdown-inline t ))))
13651375 (when use-markdown-inline
1366- (treesit-parser-create 'markdown_inline )
1376+ (treesit-parser-create 'markdown-inline )
13671377 (setq-local treesit-range-settings clojure-ts--treesit-range-settings))
13681378
13691379 (when (treesit-ready-p 'clojure )
0 commit comments