-
Notifications
You must be signed in to change notification settings - Fork 17
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
Syntax highlighting for block scalars incorrectly highlights invalid strings #26
Comments
Using the TM inspector in VSCode, it seems the problem is the |
I have tracked down the cause of this but it is not currently possible to fix due to a limitation in the grammar parser. We are investigating if/how this can be addressed in the parser. |
It is possible to use captured groups in while/end regex: (tested in VSCode)
I see that TextMate and Github highlighter already have a working version for YAML but VSCode doesn't. This might also be of interest to anyone else wishing to implement string literals by indentation... |
@aeschli, would it be possible (I could even do it if you like) to use this workaround rather than wait for TextMate to otherwise fix this? Any way to denote that the generated files require a tweak or two like this? |
@heaths As a first step I suggest to make a PR against this repo. |
This is already fixed in TextMate (tested in version 2.0-rc.23). Github uses https://github.com/atom/language-yaml/blob/master/grammars/yaml.cson which also works. I don't know if VSCode supports the CSON format but it should be trivially convertible to VSCode-compatible JSON. |
Please create an issue in the vscode repo so we can find out why this works in TextMate but not in VSCode and whether VSCode should switch to a different grammar. |
Will do, but I don't think anyone is saying this wouldn't work in VSCode - only that someone found a workaround and that this was fixed in TextMate recentlyish. |
uhhh seems still open? "unexpected scalar at node end yaml vscode" led me to this issue |
According to http://yaml.org/spec/1.2/spec.html#id2795688, any string therein should be literal and cannot be escaped; however, VSCode shows all strings having errors or otherwise incorrect. These cannot be quoted, or the quotes will - as spec'd - end up in the VSTS tasks (see screenshot).
This is generated from the following YAML (which GitHub highlights correctly):
Folded blocks have a similar problem:
...yields:
Seems any text within literal or folded blocks should be treated as plain strings,
Copied from original VSCode issue 54219.
The text was updated successfully, but these errors were encountered: