[SOLVED] Xtext : Personalize Description [message #1763947] |
Tue, 23 May 2017 10:16 |
Pascal Lacabanne Messages: 17 Registered: November 2016 |
Junior Member |
|
|
Hello,
I created a new grammar with Xtext 2.11 (it works) and I want to personnalize the autocompletion.
For example, I have two objects in my grammar
Environment:
'ENV_TYPE' name=ID
'Description' (Description=STRING)
Test
'TEST_TYPE' name=ID
'Description' (Description=STRING)
'Environment' Environment=[Environment]
I would like in eclipse during autocompletion (on Environment attribut in TEST object) retrieving Environment'ID and in the yellow part the environment's description (cf attachment)
How do you do that ?
Thank you
[Updated on: Wed, 24 May 2017 08:16] Report message to a moderator
|
|
|
|
Re: Xtext : Personalize Description [message #1763984 is a reply to message #1763950] |
Tue, 23 May 2017 15:51 |
Pascal Lacabanne Messages: 17 Registered: November 2016 |
Junior Member |
|
|
Thansk for your answer but I need help again.
I follow this tutorial https://christiandietrich.wordpress.com/2011/07/16/hover-support-in-xtext-2-0-tutorial/ but it does not work.
Here my code :
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.documentation.IEObjectDocumentationProvider;
import com.google.inject.Inject;
public class SvcIEObjectDocumentationProvider implements IEObjectDocumentationProvider {
public SvcIEObjectDocumentationProvider() {
// TODO Auto-generated constructor stub
}
@Override
public String getDocumentation(EObject o) {
return "Je mets ce que je veux";
}
}
/*
* generated by Xtext 2.11.0
*/
import com.google.inject.Inject
import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor
/**
* Use this class to register components to be used within the Eclipse IDE.
*/
@FinalFieldsConstructor
class SvcUiModule extends AbstractSvcUiModule {
@Inject
def public Class<? extends SvcIEObjectDocumentationProvider> bindIEObjectDocumentationProvider() {
return SvcIEObjectDocumentationProvider;
}
}
When Eclipse loads, I pass by bindIEObjectDocumentationProvider() but my sentence "Je mets ce que je veux" does not appear.
What have I forgotten
Thank
[Updated on: Wed, 24 May 2017 07:01] Report message to a moderator
|
|
|
Re: Xtext : Personalize Description [message #1763989 is a reply to message #1763984] |
Tue, 23 May 2017 16:43 |
|
@Inject
def public Class<? extends SvcIEObjectDocumentationProvider> bindIEObjectDocumentationProvider() {
return SvcIEObjectDocumentationProvider;
}
makes no sence. this is a binding not a injection
and the type is wrong
class MyDslUiModule extends AbstractMyDslUiModule {
def public Class<? extends IEObjectDocumentationProvider> bindIEObjectDocumentationProvider() {
return SvcIEObjectDocumentationProvider;
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
|
|
|
|
Powered by
FUDForum. Page generated in 0.03337 seconds