TextMateSharp
TextMateSharp copied to clipboard
Yaml highlighting issue with nested multi line strings
Describe the bug Syntax Highlighting appears to be broken after nested multi line strings
one: |-
this is fine
two:
two: |-
this is fine
shouldnt-be-highlighted:
test:
one: |
this is fine
two:
two: |
this is fine
shouldnt-be-highlighted:
test:
one: >
this is fine
two:
two: >
this is fine
shouldnt-be-highlighted:
test:
one: >-
this is fine
two:
two: >-
this is fine
shouldnt-be-highlighted:
test:
To Reproduce Steps to reproduce the behavior:
- Load the Yaml above
Expected behavior Lines following a nested multi line string should be highlighted correctly
Screenshots
Left is VS Code, right is AvaloniaEdit
Desktop (please complete the following information):
- OS: Windows 11
- TextMateSharp Version="1.0.56"
- Avalonia.AvaloniaEdit Version="11.0.6"
- AvaloniaEdit.TextMate Version="11.0.6"
Yepp. We should try to update to the latest version of the grammar from VSCode repository to see if this fixes the issue.
It appears that the yaml settings are pointing to the latest commit, https://github.com/danipen/TextMateSharp/blob/69616c19b39f458658c81570ab8cae6d61777e84/src/TextMateSharp.Grammars/Resources/Grammars/yaml/syntaxes/yaml.tmLanguage.json#L7 https://github.com/textmate/yaml.tmbundle/commit/e54ceae3b719506dba7e481a77cea4a8b576ae46
Yeah, you're right. We're using the same version as VSCode (the latest).
So I guess then the problem might be in the parsing engine. To fix it, we'll need to do some debugging to figure out what's wrong with the tokens.
It could also be helpful to test if the code from eclipse/tm4e is functioning correctly. If it is, we can compare it with our code to help pinpoint the issue. I'm quite swamped these days, so I'm not certain if I'll be able to address this soon.
I tested it in netbeans which uses tm4e and it renders the yaml correctly. I will keep digging.
Looks like VSCode switched to new grammar https://github.com/microsoft/vscode/commit/9255a27d883c812feae2473d7af428267c875030 There were a lot of issues with the old
We can replace our shipped grammar with the new one.
I've tried new grammar and the YAML highlight just got more broken. I will need some time to find the bug