Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Content assistant: don't show default proposal
Content assistant: don't show default proposal [message #997446] Mon, 07 January 2013 14:47 Go to next message
Tommaso De Sica is currently offline Tommaso De SicaFriend
Messages: 131
Registered: March 2012
Location: Italy
Senior Member

Good monday,

I'm looking for a way to hide some default proposals in content assistant.

Would also be useful to know how to override the behavior of default proposals. For example: "IF" proposal writes "IF" but I want to write "IF()".

How can realize it?

Very thank you!

EDIT: I need this also for XExpression: I've try to ovveride method without call super, but does not change anything.

[Updated on: Mon, 07 January 2013 14:59]

Report message to a moderator

Re: Content assistant: don't show default proposal [message #997453 is a reply to message #997446] Mon, 07 January 2013 15:26 Go to previous messageGo to next message
Tommaso De Sica is currently offline Tommaso De SicaFriend
Messages: 131
Registered: March 2012
Location: Italy
Senior Member

Solved for keyword with this method:
@Override
	public void completeKeyword(Keyword keyword,
			ContentAssistContext contentAssistContext,
			ICompletionProposalAcceptor acceptor) {
		if(keyword.getValue().equals("IF") || keyword.getValue().equals("DO") || keyword.getValue().equals("WHILE")){
			return;
		}
		super.completeKeyword(keyword, contentAssistContext, acceptor);
	}

and then I've wrote my proposals in right position with my specifics.

Remain XExpressions.
Re: Content assistant: don't show default proposal [message #997499 is a reply to message #997446] Mon, 07 January 2013 20:00 Go to previous message
Alex G is currently offline Alex GFriend
Messages: 96
Registered: January 2012
Member
Hi!

Maybe it is better in your case to do it via IGrammarAccess, if you have equal String representations of your keywords. Have a look at this.

Best regards,
Alex.
Re: Content assistant: don't show default proposal [message #997616 is a reply to message #997446] Mon, 07 January 2013 14:51 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
For keywords you have to override completekeyword
http://kthoms.wordpress.com/2012/05/22/xtext-content-assist-filtering-k
eyword-proposals/

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Symptom and Solution for Unresolved Xtext Cross-References
Next Topic:file updates and rebuilds.
Goto Forum:
  


Current Time: Thu Apr 25 01:03:06 GMT 2024

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

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

Back to the top