You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
person "Pierre with \" inside"
Hello "Pierre with \" inside"!
Link to code example: (see above)
The STRING definition is the crucial point...
The current behavior
Scoping resolution works as expected (misspell the name and you get an error as expected), but Syntax highlighting is broken (after the first string everything formatted as string).
The expected behavior
No broken highlighting.
The text was updated successfully, but these errors were encountered:
It seems that this is because the textmate file (the json file in the syntaxes folder) is not correctly generated. The terminal rule STRING generates the following
Basically, it means that it will take anything between a starting " and an ending \"x" as a string and highlight it as a string, where x is anything that is not ". Clearly there is a missing alternative operator | in the generated textmate file.
Note that the generated syntax highlighting file is just a helper to get you started with writing/extending the textMate grammar. The heuristics used in the generator to figure out the highlighting rules are fairly simple and are not intended to be complete. We accept improvements to the code though. So if you can figure out what's wrong there, any contributions are welcome.
String and comment are using the same regex visitor. Since the textmate generator is doing a good job for multiline comments, we can modify the string regex to make it look like a comment regex, such as "(\\"|[^"])*?" (note the non-greedy option), this can fix the issue, though I haven't figured out how the visitor does it. (Oops, not working actually)
Langium version: 0.5.0
Package name: langium-cli
Steps To Reproduce
yo langium
)Link to code example: (see above)
The
STRING
definition is the crucial point...The current behavior
Scoping resolution works as expected (misspell the name and you get an error as expected), but Syntax highlighting is broken (after the first string everything formatted as string).
The expected behavior
No broken highlighting.
The text was updated successfully, but these errors were encountered: