Skip to main content



      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 16:25 Go to next message
Eclipse UserFriend
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 16:06 Go to previous message
Eclipse UserFriend
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
Previous Topic:Advanced Formatting doubts
Next Topic:define type alias in DSL
Goto Forum:
  


Current Time: Tue Jul 08 16:24:03 EDT 2025

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

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

Back to the top