Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Variables in content assist (code completion)(How can I show variables/methods defined by the user?)
Variables in content assist (code completion) [message #820981] Wed, 14 March 2012 20:25 Go to next message
Maicon Zatelli is currently offline Maicon ZatelliFriend
Messages: 10
Registered: March 2012
Junior Member
Hi everyone.

I have a question about the content assist.

I would like show the same things in wherever the user press CTRL+Space.
The things that I want to show are the variables defined by the user and not the keywords.
I'm looking for some method or class that I have to extend or change, but in some places the content assist isn't showed up, because for default doesn't have suggestions.
This fact is puzzling me a little bit, because when it happens none of the methods like "complete{TypeName}_{FeatureName}" or "complete_{RuleName}" are called.

In summarize...
If I'm at a new line (blank line) and I press CTRL+Space I would like to show the content assist with all variables or methods defined by the user.
But, if I press CTRL+Space in other places I would like show the same variables.
Of course, I have to treat the prefix.
The scope doesn't matter in this case. Smile

Does anyone have idea about how I can do this?

Regards,
Maicon
Re: Variables in content assist (code completion) [message #825398 is a reply to message #820981] Tue, 20 March 2012 20:06 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13409
Registered: July 2009
Senior Member
Hi,

the complete methods are actually called. which is called depends on the place in the grammar file.
can you elaborate a bit what you exactly want to do? you posting is way to general to give advice.
i doubt you really want to override
org.eclipse.xtext.ui.editor.contentassist.AbstractContentProposalProvider.completeKeyword(Keyword, ContentAssistContext, ICompletionProposalAcceptor)
org.eclipse.xtext.ui.editor.contentassist.AbstractContentProposalProvider.completeRuleCall(RuleCall, ContentAssistContext, ICompletionProposalAcceptor)
org.eclipse.xtext.ui.editor.contentassist.AbstractContentProposalProvider.completeAssignment(Assignment, ContentAssistContext, ICompletionProposalAcceptor)
in general

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Advanced Formatting doubts
Next Topic:define type alias in DSL
Goto Forum:
  


Current Time: Sun Mar 29 22:37:20 GMT 2020

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

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

Back to the top