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 09:47 Go to next message
Tommaso De Sica is currently offline Tommaso De Sica
Messages: 128
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 09: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 10:26 Go to previous messageGo to next message
Tommaso De Sica is currently offline Tommaso De Sica
Messages: 128
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 15:00 Go to previous message
Alex G is currently offline Alex G
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 09:51 Go to previous message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6144
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
Previous Topic:Symptom and Solution for Unresolved Xtext Cross-References
Next Topic:file updates and rebuilds.
Goto Forum:
  


Current Time: Thu Jul 31 11:45:40 EDT 2014

Powered by FUDForum. Page generated in 0.01734 seconds