Hi,
This is the weekly report for the Templates project.
What the plan for this week was:
- Add syntax highlighting for comments.
At the moment, comments are not colored at all. This fix would make comments appear with the default java comment color (green).
What has been accomplished:
I did not manage to add syntax highlighting for the comments yet.
However, the first change-set that introduces syntax highlighting is now merged. It includes the following:
- Template keywords that act as java identifiers are no longer highlighted by default.
e.g.:
'newName' in 'String newName = "Name" ' is considered to be a java identifier and not a template keyword ( in '${s:newName(String)}' it is a template keyword)
- Special syntax highlighting for Template variable identifiers. You can change this colors from the preference page.(See [1] about how to do it)
e.g.:
- 'var' in ${var:newName(int)} . You can change the color of 'v' from the preference page to one of your choosing.
- 'string' in ${string} is also a template identifier. Pay attention to the template variable keywords defined in [2]. Those will not be considered identifiers, but keywords.(see examples bellow as well.)
- Special syntax highlighting for Template keywords. You can change this colors from the preference page.(See [1] about how to do it)
e.g.:
- 'enclosing_project' in ${enclosing_project} is considered to be a template keyword.(See [2] for a list of such keywords).
- 'newName' in ${name:newName(String)} is also considered to be a keyword.
Disclaimer: At the moment keywords that are used as java specific variable constructors ( See Java Specific Template Variable section from [1]) are not highlighted as template keywords. Such keywords include 'newName' from the above example, 'field' in ${id:field(String)}, etc.
In order to properly highlight these keywords, some changes in the grammar have to be made. See bug [3] for more details.
- Special syntax highlighting for template types. You can change this colors from the preference page.(See [1] about how to do it)
e.g.: - 'String' in ${id:newName(String)} is considered to be a template type.
'java.lang.Object[]' in
${container:var('java.lang.Object[]')} i
s also considered a template type, and will be highlighted accordingly.
- Syntax highlighting for strings and numeric constants is now supported.
All strings (except for those used in template types) will be highlighted as java strings, and numeric constants will have a gray color.
You can change this colors from the preference page as well.(See [1] about how to do it)
What has to be done next:
The next step now is to make the necessary changes in the grammar that will allow template keywords like 'newName' to be highlighted. I would like to postpone any further features for the syntax highlighting (like comment highlighting) until this changes are made.
As my exam period started this week, I will not be able to work during the next 2-3 weeks.
I do apologize if this causes any inconveniences.
However, if I do manage to do any work, I will keep the weekly reports, and inform you of the new features in the editor.
Best Regards,
Stefan.
[1] Go to Window -> Preference -> Template -> Syntax coloring.