[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#59679: 29.0.50; python + tree-sitter: Syntax highlighting is sometim
From: |
Yuan Fu |
Subject: |
bug#59679: 29.0.50; python + tree-sitter: Syntax highlighting is sometimes wrong with multi line docstrings |
Date: |
Wed, 30 Nov 2022 02:31:54 -0800 |
Matthias Paulmier <hello@mattplm.fr> writes:
> Steps to reproduce:
> - emacs -Q
> - find-file "foo.py"
> - write the following file
>
> ```
> def test():
> '''This is a function
>
> It just does nothing and it's ok.
> '''
> pass
> ```
> - at this point, syntax highlighting should be good
> - kill-buffer
> - find-file "foo.py"
> - syntax highlighting doesn't show properly (comment ends after "it'"
> and pass is shown with the `font-lock-doc-face')
Hmmm, it seems the tabs in the code throws tree-sitter off and makes it
parse incorrectly. But I’m not sure if the tabs are in your code or they
are added by the email provider. Do you expect the code to contain tabs?
Yuan