vscode-scala-syntax icon indicating copy to clipboard operation
vscode-scala-syntax copied to clipboard

[WIP] Implement dedented string syntax

Open lihaoyi opened this issue 6 months ago • 1 comments

SIP discussion https://github.com/scala/improvement-proposals/pulls

For now just hard-codes supports for ''', '''', ''''', ''''''`. TextMate Grammars do not allow "dynamic" lexing as far as I can tell, so we can't say "match closing delimiter with the same length as the opening delimiter", but in practice most delimiters will be short so just enumerating a number of the should be enough 99.9% of the time

lihaoyi avatar Aug 29 '25 14:08 lihaoyi

TextMate does support that use (capture groups) and backreferences \\1

"begin": "\"\"\"",
"end": "\\0(?!\")",
"beginCaptures": { "0": { "name": "punctuation.definition.string.begin.scala" } },
"endCaptures": { "0": { "name": "punctuation.definition.string.end.scala" } },
"name": "string.quoted.triple.scala",
"patterns": [
	{
		"match": "\\\\\\\\|\\\\u[0-9A-Fa-f]{4}",
		"name": "constant.character.escape.scala"
	}
]

RedCMD avatar Aug 30 '25 11:08 RedCMD