Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [recommenders-dev] [soc-dev] [GSoC] Templates weekly report

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[]')} is 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.
You should see a window similar with the one in the next screen shoot: (Note: colors in the editor from the screen shot are user-set. This are not the defaults)​

[2]: <http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Fconcepts%2Fconcept-template-variables.htm>
[3]: <https://bugs.eclipse.org/bugs/show_bug.cgi?id=436902>





On Tue, Jun 3, 2014 at 9:08 PM, Stefan Prisca <stefan.prisca@xxxxxxxxx> wrote:
Hi,

This is the weekly report for the Templates project.

What the plan for the last week was:
  • Continue testing the editor and the grammar.
    All the above changes contain specific tests, but more are needed to ensure the grammar is correct.
  • start looking into context-dependent syntax highlighting


What has been accomplished:

  • More tests have been added in the change set at [1].
    At the moment, all the grammar rules are tested, both with input files that represent possible snippets (see SmoketestTemplatesTest), as well as specific lexer and parser tests.
  • I've pushed a change set that adds context-dependent syntax highlighting for variables.[2]+(Bug 424301)
    For example, for the word "int", this works in the following way:
    • used as type definition: "int s;" -> it is highlighted (even if it is in a template variable : "${s:newName(int)}"
    • used as a template variable id: "${int:newName(int)}" -> it is not highlighted.

      See the screenshot at [3] for more examples of different highlights.

What the plan for next week is:

My exam period starts next week and I won't be able to work that much.

  • 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).


Best Regards,
Stefan.


[1]:<https://git.eclipse.org/r/#/c/27609/>

[2]: <https://git.eclipse.org/r/#/c/27862/>

[3]:​






On Wed, May 28, 2014 at 12:13 AM, Stefan Prisca <stefan.prisca@xxxxxxxxx> wrote:
Sorry, I forgot to add the plan for this week.

What the plan for this week is:

  • Continue testing the editor and the grammar.
    All the above changes contain specific tests, but more are needed to ensure the grammar is correct.
  • Start doing some more research on how to implement code completion, and how to do this for the Template editor.


Best Regards,

Stefan.

P.S. The links from the above mail:

[1]: https://git.eclipse.org/r/#/c/26776/

[2]: https://bugs.eclipse.org/bugs/show_bug.cgi?id=434434

[3]: https://git.eclipse.org/r/#/c/27274/

[4]: https://bugs.eclipse.org/bugs/show_bug.cgi?id=435630

[5]: https://git.eclipse.org/r/#/c/27297/

[6]:https://bugs.eclipse.org/bugs/show_bug.cgi?id=435423

[7]:https://git.eclipse.org/r/#/c/27300/

[8]:https://bugs.eclipse.org/bugs/show_bug.cgi?id=435427




On Wed, May 28, 2014 at 12:01 AM, Stefan Prisca <stefan.prisca@xxxxxxxxx> wrote:
Hi,

This is the weekly report for the Templates project.

First of all, I think the report for last week did not reach the mailing lists. It just occurred to me now that I've somehow managed to send it to myself instead of the lists.
I apologize for this, and I'm forwarding it to you now.

The report for this week is the following:

What the plan for this week was:


  • Merge the changes mentioned above.
  • Further test the editor and add more test cases for the grammar.
    The main focus of this new test cases will be the lexer and the parser. We should be sure that each string is consumed by the rule we expect it to be, and that the grammar is stable enough to move forward.
What has been accomplished:

  • I updated the grammar according to the Java 8 Language Specification.
    A few new separators were introduced ("@", "...", etc) and I've modified the structure of numeric constant terminals.
    Syntax coloring for numeric constants was also fixed by this changes.
    You can track this on gerrit[1] or on bugzilla[2].
  • I pushed a change that helps solve the issue with ${enclosing_type} and ${enclosing_project} template variables.[3]
    These were not declared in the grammar as valid template variables, and were not treated so. You can follow the change here[4]
  • I pushed two more change sets that remove the unnecessary dependencies from the o.e.r.templates.3rd.feature(gerrit: [5], bugzilla: [6]) project and lowered the limits of the dependencies from o.e.r.templates and o.e.r.templates.rcp to XText form 3.0.0 to 2.7.0.(gerrit: [7], bugzilla: [8])


---------- Forwarded message ----------
From: <stefan.prisca@xxxxxxxxx>
Date: Tue, May 20, 2014 at 7:52 PM
Subject: Re: [soc-dev] [GSoC] Templates weekly report
To: "stefan.prisca@xxxxxxxxx" <stefan.prisca@xxxxxxxxx>


​ ​
Hi,

This is the weekly report for the Templates project.

What had been planned for the last week:

  • Resolve the build problem.
  • Write more tests, both for the parser, as well as the lexer. We also need to ensure that the lexer will pass the expected token to the parser. 
    For example, see Bug 434434. Here, the numeric constants might not be matched to the expected tokens, hence there are some highlighting problems. 

What had been done last week:

  • Thanks to Andreas, the build issue from last week has been resolved. Apparently jdt.annotations 2.0.0 was bringing java 8 compiled files. A filter that would ensure a maximum exclusive version of 2.0.0 for jdt.annotations did the trick.
  • I submitted a change set that plans to solve Bug 434434. Except the wrong syntax highlighting, the scientific notation for float numbers was not supported.
    This change set [1] in gerrit adds the support for scientific notations, as well as tests for it and for the way the lexer treats numeric constants.
  • I submitted a change ([2]) that deletes the old snipmatch code from the repository. at [3]
    This change will also add a new feature project (o.e.r.templates.3rd.feature) that will contain the 3rd party dependencies form o.e.r.templates project.
None of the above changes was yet merged. Because the build fails at the moment, I will wait until the change that removes the old snipmatch code and adds the new way of treating 3rd party dependencies is merged, and then merge the others.


What is the plan for the next week:

  • Merge the changes mentioned above.
  • Further test the editor and add more test cases for the grammar.
    The main focus of this new test cases will be the lexer and the parser. We should be sure that each string is consumed by the rule we expect it to be, and that the grammar is stable enough to move forward.

Best Regards,
Stefan.


From: stefan.prisca@xxxxxxxxx
Sent: ‎Tuesday‎, ‎May‎ ‎13‎, ‎2014 ‎9‎:‎44‎ ‎PM
To: soc-dev@xxxxxxxxxxx, recommenders-dev@xxxxxxxxxxx

Hi,

This is the weekly report for the Templates project.

What had been planned for the last week:
  • Continue working on Bug 431623. You can keep track of this on gerrit [1].

  • Add specific tests for more rules. The tests would be similar to the ones described above.
  • Create a feature project for o.e.r.templates. This will make it possible (and simple) for anyone who wishes, to install the editor from the update-site and test it (note that any feedback is highly appreciated 😉 ).
    I will send a notification mail on the lists once the update-site for the editor is up and going.
    The first patch can be found on gerrit [2]. 

What had been done last week:
  • Another patch-set has been pushed to gerrit that solved the conflicts in the grammar. Basically, when there is a conflict between JavaIdentifier and SimpleVariable rules, the parser will choose SimpleVariable.
  • The feature project for o.e.r.templates is working.

A problem with the build occurred before submitting the patch to solve Bug 431623. It appears that one of the dependencies from o.e.r.templates is now bringing o.e.jdt.annotation version 2.0.0 into the build. The classes from this plug-in are compiled with java 8 and are incompatible with our java version.

I’ve been trying to figure out what dependency brings in the o.e.jdt.annotation plug-in, but without any luck. In the dependency tree view from the Eclipse IDE only the 1.1.0 version of  o.e.jdt.annotation is present.

What is the plan for the next week:
  • Resolve the build problem.
  • Write more tests, both for the parser, as well as the lexer. We also need to ensure that the lexer will pass the expected token to the parser. 
    For example, see Bug 434434. Here, the numeric constants might not be matched to the expected tokens, hence there are some highlighting problems. 

Best Regards,
Stefan.

From: stefan.prisca@xxxxxxxxx
Sent: ‎Tuesday‎, ‎May‎ ‎6‎, ‎2014 ‎7‎:‎43‎ ‎PM
To: soc-dev@xxxxxxxxxxx, recommenders-dev@xxxxxxxxxxx

Hi,

This is the weekly report for the Templates project.

What had been planned for the last week:

  • Fix Bug 431623. This will allow the use of java identifiers and keywords as link variable proposals, and also as simple template variables (e.g. ${class}).

What had been done last week:

  • I have submitted a couple of patch-sets that would solve this bug, but it turned out that this causes some conflicts created in the grammar. The problem is that JavaIdentifier and SimpleVariable mostly define the same tokens. A solution would be to make some small restructuring in the grammar and remove any tokens that were defined twice. i.e. SimpleVariable rule will remain as it is and JavaIdentifier will define only the tokens that are not already defined in SimpleVariable. (Maybe some renaming would be good)

  • Added some more test cases that check if the parser matches the input strings with the rules as it is supposed to. This tests are more specific to a certain rule, and make it clearer what rules are matched for certain inputs.

What is the plan for the next week:

  • Continue working on Bug 431623. You can keep track of this on gerrit [1].

  • Add specific tests for more rules. The tests would be similar to the ones described above.
  • Create a feature project for o.e.r.templates. This will make it possible (and simple) for anyone who wishes, to install the editor from the update-site and test it (note that any feedback is highly appreciated 😉 ).
    I will send a notification mail on the lists once the update-site for the editor is up and going.
    The first patch can be found on gerrit [2]. 






Back to the top