GNU bug report logs - #77733
31.0.50; Issue with treesit-range-settings and multiple grammars

Previous Next

Package: emacs;

Reported by: Roman Rudakov <rrudakov <at> fastmail.com>

Date: Fri, 11 Apr 2025 09:55:02 UTC

Severity: normal

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Roman Rudakov <rrudakov <at> fastmail.com>
Cc: 77733 <at> debbugs.gnu.org
Subject: bug#77733: 31.0.50; Issue with treesit-range-settings and multiple grammars
Date: Mon, 14 Apr 2025 20:59:05 +0300
> 3. Remove one of backticks from the first docstring.
>
> Expected result: syntax highlighting of the Clojure code is not affected.
>
> Actual result: part of the Clojure code is highlighted with the face
> defined for markdown code_span query. Image attached.
>
> P.S. There is a possibility that an issue within clojure-ts-mode is the
> cause. Any advice on how to resolve this would be appreciated. Thank you in
> advance.

Since the expected result is that syntax highlighting of the Clojure code
should not be affected, then the solution would be to create isolated
local parsers:

@@ -345,6 +345,7 @@
   (treesit-range-rules
    :embed 'markdown-inline
    :host 'clojure
+   :local t
    (clojure-ts--docstring-query '@capture)))
 
 (defun clojure-ts--font-lock-settings (markdown-available)
@@ -1380,7 +1381,6 @@
   (let ((use-markdown-inline (and clojure-ts-use-markdown-inline
                                   (treesit-ready-p 'markdown-inline t))))
     (when use-markdown-inline
-      (treesit-parser-create 'markdown-inline)
       (setq-local treesit-range-settings clojure-ts--treesit-range-settings))
 
     (when (treesit-ready-p 'clojure)




This bug report was last modified 36 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.