vaulttec / veloedit

Eclipse editor for the Velocity Template Language (VTL)
Eclipse Public License 1.0
41 stars 4 forks source link

Syntax highlighting "bugs" when using "." or "(" #18

Open thiesw opened 4 years ago

thiesw commented 4 years ago

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.