codemirror / codemirror5

In-browser code editor (version 5, legacy)
http://codemirror.net/5/
MIT License
26.78k stars 4.96k forks source link

Wrong syntax highlighting for Groovy GStrings when interpolating values #7103

Closed FranzMartyn closed 1 month ago

FranzMartyn commented 1 month ago

I am coming from this codewars issue , which uses codemirror 5 for it's editor.

Sometimes, codewars' editor gets the syntax highlighting for GStrings wrong when they contain interpolated values.

Codewars' editor does this:

image

instead of this (example from Intellij Idea):

image

But the syntax highlighting on codewars' editor works when adding curly braces:

image

FranzMartyn commented 1 month ago

It seems to display how it should when a character, that is neither a letter, nor a digit, nor whitespace, comes after the interpolated value

image

marijnh commented 1 month ago

Attached patch should help.