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: Roman Rudakov <rrudakov <at> fastmail.com>
To: Juri Linkov <juri <at> linkov.net>
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:35:59 +0200
Juri Linkov <juri <at> linkov.net> writes:

>> 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)
Amazing! I tried to use ':local t' in the range function, but I didn't 
try removing '(treesit-parser-create 'markdown-inline)' line, which 
apparently solves the problem.

Thank you very much for helping, Juri! This bug can be closed.
--
Best regards, Roman




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.