|
Re: [xtend2] Use comments as doc [message #732297 is a reply to message #732292] |
Tue, 04 October 2011 12:47 |
|
Hi,
i guess you have to come up with a patched
Xtend2Compiler that uses MultiLineCommentDocumentationProvider
to get the comments. unfortunately xtend2
has no nice hooks to change code.
~Christian
Am 04.10.2011 14:23, schrieb Hauke Fuhrmann:
> Hi there,
>
> is there a way that comments in xtend2 can be used as Eclipse integrated
> comments such as when hovering or autocompleting functions? Just like
> Javadoc comments are used by the JDT. Is there a way to transfer
> comments in an xtend class into the generated Java class such that the
> JDT can pick them up?
>
> Cheers,
> Hauke
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: [xtend2] Use comments as doc [message #732298 is a reply to message #732297] |
Tue, 04 October 2011 13:08 |
|
Here a very basic version:
import
org.eclipse.xtext.documentation.impl.MultiLineCommentDocumentationProvider;
import org.eclipse.xtext.xbase.compiler.IAppendable;
import org.eclipse.xtext.xtend2.compiler.Xtend2Compiler;
import org.eclipse.xtext.xtend2.xtend2.XtendClass;
import com.google.inject.Inject;
public class ExtendedXtend2Compiler extends Xtend2Compiler {
@Inject MultiLineCommentDocumentationProvider mlcdp;
@Override
protected void compile(XtendClass obj, IAppendable appendable) {
String doc = mlcdp.getDocumentation(obj);
if (doc != null) {
appendable.append("/**\n");
appendable.append(doc);
appendable.append("\n*/");
}
super.compile(obj, appendable);
}
}
Am 04.10.2011 14:47, schrieb Christian Dietrich:
> Hi,
>
> i guess you have to come up with a patched
> Xtend2Compiler that uses MultiLineCommentDocumentationProvider
> to get the comments. unfortunately xtend2
> has no nice hooks to change code.
>
> ~Christian
>
> Am 04.10.2011 14:23, schrieb Hauke Fuhrmann:
>> Hi there,
>>
>> is there a way that comments in xtend2 can be used as Eclipse integrated
>> comments such as when hovering or autocompleting functions? Just like
>> Javadoc comments are used by the JDT. Is there a way to transfer
>> comments in an xtend class into the generated Java class such that the
>> JDT can pick them up?
>>
>> Cheers,
>> Hauke
>
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: [xtend2] Use comments as doc [message #733483 is a reply to message #732292] |
Tue, 04 October 2011 20:56 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
This will likely be added in Xtext 2.1 (Beginning of November).
Am 04.10.11 14:23, schrieb Hauke Fuhrmann:
> Hi there,
>
> is there a way that comments in xtend2 can be used as Eclipse integrated
> comments such as when hovering or autocompleting functions? Just like
> Javadoc comments are used by the JDT. Is there a way to transfer
> comments in an xtend class into the generated Java class such that the
> JDT can pick them up?
>
> Cheers,
> Hauke
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
Powered by
FUDForum. Page generated in 0.03715 seconds