Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thiesw opened this issue Jan 8, 2020 · 0 comments
Open

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

thiesw opened this issue Jan 8, 2020 · 0 comments

Comments

@thiesw
Copy link

thiesw commented Jan 8, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant