-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XML highlighting fails with comment of certain length in document root #5470
Comments
This is a bug in https://github.com/RenjiSann/tree-sitter-xml. Putting the comment near the top of the file seems to cause problems. @RenjiSann, can you take a look at this when you have time? |
Thank you for letting me know about this. I will try to investigate |
The error is already present in the project I forked, I only modified it slightly and added a default highlight.scm. I will try to dive in the XML syntax and find the error, but I'm not sure I will succeed. |
I've tried to understand how's the grammar working, but tbh it's to big for me to track the bug down any time soon. I might do it all over again, though it will be much simpler, just to ensure syntax highlighting |
Maybe the author of the original repository will find a bug? Can you take a look @dorgnarg? |
Hi ! I was able to take a look at the bug. It appeared that the project I forked confused single and multiple spaces in the grammar. This is not entirely fixed yet because I am trying to avoid regression and lack proper testing. |
Summary
XML highlighting fails if there is a comment in the XML document root which has at least a certain length.
This fails:
This works (One "X" less in the comment line):
Reproduction Steps
I tried this:
hx
:lang xml
I expected this to happen:
Highlighting succeeds
Instead, this happened:
Highlighting fails (see screenshot)
Helix log
(Nothing in the helix log.)
Platform
openSUSE Tumbleweed - Linux
Terminal Emulator
Konsole
Helix Version
helix 22.12
The text was updated successfully, but these errors were encountered: