Skip to main content


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: 35
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 offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
No you can't
The copying is done manually in the xtend impl


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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: 35
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 offline Christian DietrichFriend
Messages: 14661
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)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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: 35
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 messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
id write to the xtext-dev mailing list https://dev.eclipse.org/mailman/listinfo/xtext-dev

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XTend code generation and comments [message #1836433 is a reply to message #1750735] Mon, 04 January 2021 10:04 Go to previous messageGo to next message
Dineth Mendis is currently offline Dineth MendisFriend
Messages: 2
Registered: January 2021
Junior Member
Hi, Is this implemented yet to convert all the comments from xtend to Java including // comments ? Thanks
Re: XTend code generation and comments [message #1836454 is a reply to message #1836433] Mon, 04 January 2021 17:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
no, xtend handles no // comments

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XTend code generation and comments [message #1836650 is a reply to message #1750735] Mon, 11 January 2021 09:53 Go to previous messageGo to next message
Dineth Mendis is currently offline Dineth MendisFriend
Messages: 2
Registered: January 2021
Junior Member
Hi. Additionally another question related to below code.

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

Can we now convert all the block comments above from xtend to java or still comment 1 and comment 2 only converted yet ? Thanks in advance.
Re: XTend code generation and comments [message #1836651 is a reply to message #1836650] Mon, 11 January 2021 11:11 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
only method and class and field comments

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Xtend Maven issues after upgrading to Java 9
Next Topic:Why add a pair of brackets will lead to Cannot invoke...EClassifierInfo.getEClassifier()?
Goto Forum:
  


Current Time: Fri Mar 29 07:47:57 GMT 2024

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

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

Back to the top