Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Content assist and STRING objects
Content assist and STRING objects [message #559068] Wed, 15 September 2010 13:54 Go to next message
Jerome is currently offline JeromeFriend
Messages: 5
Registered: September 2010
Junior Member
Hello dear Xtext community,

Just a small question about content assist proposal. I try to customize the Ctrl+space proposal when the grammar states something like: myValue=STRING with STRING defined in org.eclipse.xtext.common.Terminals

When I encounter myValue, the content assist will automatically propose "myValue" as a possible (and only one) value. How can I override this behaviour and propose a customized message ? Is that on the documentation ?

Looks like the default ProposalProvider calls a completeRuleCall (...) with a rule named "STRING". But I couldn't find any AbstractRule implementation (never used ?) nor understand what's behind that completeRuleCall method Surprised .

Thanks and sorry if that question was already answered, I couldn't find it on the archives.

Jérôme

[Updated on: Wed, 15 September 2010 13:54]

Report message to a moderator

Re: Content assist and STRING objects [message #559070 is a reply to message #559068] Wed, 15 September 2010 14:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

you have to overwrite

public void complete_STRING(EObject model, RuleCall ruleCall,
ContentAssistContext context, ICompletionProposalAcceptor acceptor)

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Content assist and STRING objects [message #559072 is a reply to message #559068] Wed, 15 September 2010 14:06 Go to previous message
Jerome is currently offline JeromeFriend
Messages: 5
Registered: September 2010
Junior Member
Okay I get it, I didn't realize that types defined in org.eclipse.xtext.common.Terminals were handled in the org.eclipse.xtext.common.ui.contentassist.TerminalsProposalP rovider.

Thanks a lot, I'll find my way now Cool

Jérôme

[Updated on: Wed, 15 September 2010 14:07]

Report message to a moderator

Previous Topic:Autocompletion remains empty
Next Topic:Data Type Rule and EMF
Goto Forum:
  


Current Time: Thu Apr 25 02:19:33 GMT 2024

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

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

Back to the top