Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XTend code generation and comments
XTend code generation and comments [message #1750734] Tue, 27 December 2016 16:29 Go to next message
Eric Salemi is currently offline Eric SalemiFriend
Messages: 34
Registered: September 2016
Location: Belgium
Member
I noticed that the XTend infrastructure does not copy all comments over to the generated java file. Comments of the form "/*...*/" are copied but not comments of the form "//...".

Can I turn it on?
Is it implemented at all?



Re: XTend code generation and comments [message #1750735 is a reply to message #1750734] Tue, 27 December 2016 16:31 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 10551
Registered: July 2009
Senior Member
No you can't
The copying is done manually in the xtend impl
Re: XTend code generation and comments [message #1750736 is a reply to message #1750735] Tue, 27 December 2016 16:41 Go to previous messageGo to next message
Eric Salemi is currently offline Eric SalemiFriend
Messages: 34
Registered: September 2016
Location: Belgium
Member
Actually comments are not always copied.

For example the xtend code below:

package flax.sandbox

/* comment 1 */
class Test {
    /* comment 2 */
    def void doSomething(String /* comment3 */ myParameter) {
        /* comment 4*/
    }
}


is transformed into:

package flax.sandbox;

/**
 * comment 1
 */
@SuppressWarnings("all")
public class Test {
  /**
   * comment 2
   */
  public void doSomething(final String myParameter) {
  }
}


This would be handy for IDE that parses stuff from comments (i.e IntelliJ IDEA todo feature).

Is that worth a feature request?
Re: XTend code generation and comments [message #1750737 is a reply to message #1750736] Tue, 27 December 2016 16:59 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 10551
Registered: July 2009
Senior Member
yes but xtext handles this (TODO/TASK Markers) stuff on the source base, not on the generated java base.
i dont know what is implemented in the xtext idea code base (there is no maintainer on it right now)
Re: XTend code generation and comments [message #1750739 is a reply to message #1750737] Tue, 27 December 2016 17:17 Go to previous messageGo to next message
Eric Salemi is currently offline Eric SalemiFriend
Messages: 34
Registered: September 2016
Location: Belgium
Member
Apparenty nothing has been implemented yet with regards to TODO.

I am seriously considering contributing to the idea code base because there are many issues that need to get solved.

Who should I contact for that?
Re: XTend code generation and comments [message #1750740 is a reply to message #1750739] Tue, 27 December 2016 17:21 Go to previous message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 10551
Registered: July 2009
Senior Member
id write to the xtext-dev mailing list https://dev.eclipse.org/mailman/listinfo/xtext-dev
Previous Topic:how to run junit test from maven
Next Topic:Validator for my language
Goto Forum:
  


Current Time: Fri May 26 19:08:56 GMT 2017

Powered by FUDForum. Page generated in 0.02725 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software