pfgithub / language-zig-zls

atom zig grammar and zls
MIT License
2 stars 1 forks source link

Multi-line strings syntax highlighting #4

Open Leakbang opened 2 years ago

Leakbang commented 2 years ago

There is a tiny issue with the syntax highlighting of multi-line strings. For example in the code below the 'comment highlighting' (default: green) should stop at the commented line.

fn function() void {
    const text = std.fmt.comptimePrint(
    \\ Multi
    \\ Line 
    \\ Strings
    \\ {variable}
    // Comment coloring/Highlighting should stop here <-
    , .{.variable = "Are cool"});
    std.log.default.info("{s}", .{text});
}

But this is what happens: image

The whole rest of the code becomes green :green_book:

Skehmatics commented 7 months ago

Does not happen for me (as of ZLS 0.12.0-dev.512+9ba474 and pulsar v1.116, the tech equivalent of a lifetime later). This may have been a ZLS bug

pfgithub commented 7 months ago

I don't think it can be a zls bug, zls doesn't provide coloring. It's likely an issue with the tree-sitter syntax and it may be fixed this version of the grammar: https://github.com/maxxnino/tree-sitter-zig/blob/main/src/grammar.json .

Since the existing grammar was textmate, it's likely that an atom update fixed it. That was an issue I've seen with textmate grammars before that happened on atom but not vscode.