Skip to content
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

String with escape in string breaks syntax highlighting in VS Code #6014

Open
Enyium opened this issue Aug 30, 2024 · 2 comments
Open

String with escape in string breaks syntax highlighting in VS Code #6014

Enyium opened this issue Aug 30, 2024 · 2 comments
Labels
a:editor integration VSCode extension, treesitter, and other editor integration (mT,bO) bug Something isn't working

Comments

@Enyium
Copy link
Contributor

Enyium commented Aug 30, 2024

Consider this .slint code:

import { Button } from "std-widgets.slint";

export component AppWindow {
    property <int> value;

    Text {
        text: "\{root.value > 0 ? "\u{2003}" : ""}";
    }

    Button {
        clicked => {
            // ...
        }
    }
}

It works, but is rendered for me in VS Code on Windows 10 in the following broken way:

broken-highlighting

With just the string } instead of the whole escape sequence, it's still broken:

still-broken-highlighting

With only { though, everything is correct:

nonbroken-highlighting

@ogoffart ogoffart added bug Something isn't working a:editor integration VSCode extension, treesitter, and other editor integration (mT,bO) labels Aug 31, 2024
@ogoffart
Copy link
Member

Interestingly, the snippet you pasted on github has a similar issue in the github highlighting.
So this point out to a bug in the textmate grammar (https://github.com/slint-ui/slint/blob/master/editors/vscode/slint.tmLanguage.json) which is used by both.

@hunger
Copy link
Member

hunger commented Sep 2, 2024

This is not fixable within the limits of the textmate grammar :-/ It's basically regular expressions matching line contents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:editor integration VSCode extension, treesitter, and other editor integration (mT,bO) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants