-
Notifications
You must be signed in to change notification settings - Fork 0
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
Commented out CSS string breaks syntax highlighting for rest of file #6
Comments
Hey @MorningLightMountain713, thanks for reporting this issue! As a temporary workaround, may I suggest that you comment out the class Test(Widget):
'''
DEFAULT_CSS = """
Test {
width: auto;
height: auto;
}
"""
''' This won't break highlighting for the remainder of the file. |
@rodrigogiraoserrao What would be involved in fixing this? |
A “quick & dirty” solution: Pathological cases like the one below would still fail, but maybe they're so pathological that it is ok: class Test(Widget):
some_class_var = 3; DEFAULT_CSS = """Test { width: auto; height; auto }""" For the more foolproof solution I'd need to check the VS Code extension docs. |
I see. I assumed it was more clever than that. So it would break if you used single quotes? If regex is the only solution then I think it will be difficult if not impossible to completely guard against it. |
No, it doesn't break with single quotes and I think the quick & dirty fix is well worth it. The whole grammar is a bunch of regular expressions because that's just the format for syntax highlighting, there's not much I can do about it. For smarter things, I think we'd need a language server that runs in the background. |
Given there is a workaround, suggest we park this for now. We can revisit it in the future to make it a bit smarter. |
Eg
Makes the rest of the file change colors. The first triple quote is still visible.
Here is a screenshot:
Normal:
The text was updated successfully, but these errors were encountered: