Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to customize hint in language editor?
How to customize hint in language editor? [message #1700073] Tue, 30 June 2015 01:31 Go to next message
Jingang Zhou is currently offline Jingang ZhouFriend
Messages: 57
Registered: December 2010
Member
Hi,

I want to change the hint content (see the picture below) of my language editor, is it possible and where to start?

index.php/fa/22348/0/

Thanks.
  • Attachment: feature.PNG
    (Size: 10.19KB, Downloaded 273 times)
Re: How to customize hint in language editor? [message #1700077 is a reply to message #1700073] Tue, 30 June 2015 03:41 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
you have to implement IEObjectDocumentationProvider, IEObjectDocumentationProviderExtension
e.g. by

class MyDslDocumentationProvider extends MultiLineCommentDocumentationProvider {
	
	override getDocumentation(EObject o) {
		if (o instanceof Greeting) {
			return "Hey, " + o.name
		}
		super.getDocumentation(o)
	}
	
}


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to customize hint in language editor? [message #1700082 is a reply to message #1700077] Tue, 30 June 2015 05:02 Go to previous messageGo to next message
Jingang Zhou is currently offline Jingang ZhouFriend
Messages: 57
Registered: December 2010
Member
Christian Dietrich wrote on Mon, 29 June 2015 23:41
you have to implement IEObjectDocumentationProvider, IEObjectDocumentationProviderExtension
e.g. by

class MyDslDocumentationProvider extends MultiLineCommentDocumentationProvider {
	
	override getDocumentation(EObject o) {
		if (o instanceof Greeting) {
			return "Hey, " + o.name
		}
		super.getDocumentation(o)
	}
	
}


But where to bind the new DocumentationProvider?
Thanks.
Re: How to customize hint in language editor? [message #1700083 is a reply to message #1700082] Tue, 30 June 2015 05:04 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Ui module

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to customize hint in language editor? [message #1700088 is a reply to message #1700083] Tue, 30 June 2015 06:06 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
Hi Christian,

as I am a beginner in Java etc.

Can you give me some more complete advice how the binding has to be done?

I know it's boring to tell us babies how to walk, but it's important to grow up.

TIA from Frankfurt/Germany,
Uli
Re: How to customize hint in language editor? [message #1700089 is a reply to message #1700088] Tue, 30 June 2015 06:10 Go to previous messageGo to next message
Jingang Zhou is currently offline Jingang ZhouFriend
Messages: 57
Registered: December 2010
Member
Thanks.

I found the blogs https://christiandietrich.wordpress.com/2011/07/16/hover-support-in-xtext-2-0-tutorial/
and https://ckulla.wordpress.com/2011/02/06/hover-support-in-xtext-2-0/
are very helpful.
Re: How to customize hint in language editor? [message #1700093 is a reply to message #1700089] Tue, 30 June 2015 06:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
@Uli,

a general answer how a new binding has to be added cannot be given. the xtext documentation on hoiw to use guice suggests to

    public Class<? extends IScopeProvider> bindIScopeProvider() {
      return MyConcreteScopeProvider.class;
    }


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to customize hint in language editor? [message #1700103 is a reply to message #1700089] Tue, 30 June 2015 07:25 Go to previous message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
Hi Jingang,

thanks for the links, I think they will give me the necessary information to complete the greeting Hover example.

Uli
Previous Topic:Serialize extended Model with its parent language serializer.
Next Topic:Quickfix and format problem
Goto Forum:
  


Current Time: Tue Mar 19 04:29:38 GMT 2024

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

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

Back to the top