Syntax highlighting is not complete in some cases, correction should be very simple in most cases:
OKAY: $foo${foo}${foo.bar}
WRONG (stops at "."): $foo.bar$foo.bar.baz$foo.function(param)
Solution idea:
add "." to valid reference characters.
for function call the text upto the closing ")" should be highlighted, maybe the part "(...)" even in a different color, e.g. "reference parameters")
Directives may have parenthesis, e.g. #foreach($x in $coll) or #if(condition)
The whole text (upto closing ")") should be highlighted as directive, but references therein should be colored as reference of course, so "#foreach ... )" as directive but "$x" und $coll" as reference.
A full correct implementation involves parsing because "()" can be nested here - but a first (and quick) correction may simple look for the first ")" because this is the 80-90% use case.
Syntax highlighting is not complete in some cases, correction should be very simple in most cases:
OKAY:
$foo
${foo}
${foo.bar}
WRONG (stops at "."):$foo.bar
$foo.bar.baz
$foo.function(param)
Solution idea:
Directives may have parenthesis, e.g.
#foreach($x in $coll)
or#if(condition)
The whole text (upto closing ")") should be highlighted as directive, but references therein should be colored as reference of course, so "#foreach ... )" as directive but "$x" und $coll" as reference. A full correct implementation involves parsing because "()" can be nested here - but a first (and quick) correction may simple look for the first ")" because this is the 80-90% use case.