vscode-tmlanguage icon indicating copy to clipboard operation
vscode-tmlanguage copied to clipboard

[regression] TextMate YAML highlighting

Open RedCMD opened this issue 11 months ago • 4 comments

https://github.com/pedro-w/vscode-tmlanguage/commit/0aa687c4e1a60ce5e186461c598912531a84ae14 changed the custom TextMate YAML highlighting to just normal YAML highlighting

Before: Image

Now: Image

RedCMD avatar Feb 13 '25 04:02 RedCMD

I see what you mean. That commit was a while ago but I think there were problems with the highlighter as it was, and it seemed simpler to use the 'standard' one. Hopefully we can find a hybrid version to add back in the specific highlighting. On that subject - is the red highlighting of { in the top picture significant / desirable?

pedro-w avatar Feb 13 '25 11:02 pedro-w

the { being highlighted as red is a bug \{ should be treated as string, which it is currently not so VSCode thinks it is a opening bracket without a closing bracket

RedCMD avatar Feb 13 '25 21:02 RedCMD

I can replace the highlighter file with this one: https://raw.githubusercontent.com/SublimeText/PackageDev/refs/heads/master/Package/TextMate%20Syntax%20Definition%20(YAML)/TextMate%20Syntax%20Definition%20(YAML).tmLanguage and we get back to something that looks like the custom highlighting in the first screen shot. It still has the red highlighting on '{' though. Question is, can I just copy this file over? That repo and this one are both MIT licensed. What do you think @RedCMD ?

pedro-w avatar Apr 07 '25 19:04 pedro-w

mit license is fine

you can add "tokenTypes" under "grammars" in package.json to change the standard token type for certain scopes

"tokenTypes": {
	"constant.character.escape": "string"
},

Image

and the onigregex file https://github.com/SublimeText/PackageDev/blob/master/Package/TextMate%20Syntax%20Definition%20(YAML)/Oniguruma%20Regular%20Expression.tmLanguage

RedCMD avatar Apr 08 '25 04:04 RedCMD