The following program:
import stream
import stringbuffer
def main() =
println("test: ${collectString { ['h', 'e', 'l', 'l', 'o'].each }}")
highlights wrongly:

I think the rough idea is to count braces inside of the splice -- maybe allow these as a separate top-level pattern that has higher priority than string interpolation, then everything might just work out ®.
Here's the relevant code:
|
"stringTemplates": { |
|
"begin": "\\$\\{", |
|
"beginCaptures": { |
|
"0": { "name": "punctuation.definition.template-expression.begin.effekt" } |
|
}, |
|
"end": "\\}", |
|
"endCaptures": { |
|
"0": { "name": "punctuation.definition.template-expression.end.effekt" } |
|
}, |
|
"name": "meta.embedded.line.effekt", |
|
"patterns": [ |
|
{ "include": "$self" } |
|
] |
|
}, |
The following program:
highlights wrongly:

I think the rough idea is to count braces inside of the splice -- maybe allow these as a separate top-level pattern that has higher priority than string interpolation, then everything might just work out ®.
Here's the relevant code:
effekt-vscode/syntaxes/effekt.tmLanguage.json
Lines 245 to 258 in e9241a1