GNU bug report logs - #67262
python-ts-mode cannot identify triple-quoted-strings

Previous Next

Package: emacs;

Reported by: JD Smith <jdtsmith <at> gmail.com>

Date: Sat, 18 Nov 2023 15:53:02 UTC

Severity: normal

Merged with 67394

Found in version 29.1.90

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 67262 <at> debbugs.gnu.org (full text, mbox):

From: JD Smith <jdtsmith <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 67262 <at> debbugs.gnu.org
Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings
Date: Sat, 25 Nov 2023 09:42:23 -0500
Bridging emacs syntax to treesitter in a robust way seems like it could be a subtle enterprise, so I’d prefer to leave that to one of the experts.  Right now the syntax-propertize-function in python-mode does one simple thing: ensure triple quotes are properly marked as strings.  Since the treesitter grammar doesn’t distinguish between different flavors of strings, something similar would still be needed, if we want to continue to treat various string flavors distinctly using syntax.  

Is moving all syntactification (beyond just font-lock) over to TS an explicit goal for all the *-ts-mode’s?

> On Nov 25, 2023, at 5:01 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> Date: Sun, 19 Nov 2023 00:52:06 +0200
>> Cc: 67262 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dmitry <at> gutov.dev>
>> 
>> On 18/11/2023 19:18, JD Smith wrote:
>>>   (setq-local syntax-propertize-function 
>>> python-syntax-propertize-function)
>> 
>> This is not a bad choice, but even better would be to write a s-p-f 
>> based on the tree-sitter parse tree.
>> 
>> There are examples in ruby-ts-mode and js-ts-mode.
> 
> JD, would you like to try writing such a syntax-propertize-function?





This bug report was last modified 1 year and 152 days ago.

Previous Next


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