Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XTEXT Custom Content Assist(Content Assist)
XTEXT Custom Content Assist [message #1804221] Wed, 20 March 2019 15:52 Go to next message
Santhiveeran S is currently offline Santhiveeran SFriend
Messages: 7
Registered: November 2018
Junior Member
Hi All,
Thanks for reading my queries and help me.

I have a grammar to declare variables,

SetenvInstruction:
'setenv '(name=Variable)' '(value=VariableValue)
;

the grammar is working fine, I am facing one abnormal behavior in content assist. I want to show the full pattern of the syntax so I created MyDSLProposalProvider
and override the setenv

override complete_SetenvInstruction(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
super.complete_SetenvInstruction(model, ruleCall, context, acceptor)
acceptor.accept(this.createCompletionProposal("\t setenv envvar value","SetEnv",null,context))
}

The issue is I am not getting this "SetEnv" at all time. Only if some content already in the line, then I press ctrl + space, I am getting this SetEnv.
If I press enter key and in new fresh line, I press ctrl+space, I am getting normal content assist but this "SetEnv" is missing.

I didnt get any clue to find the problem.

I tried to check the prefix, in both cases the prefix is empty and newline character.

I have removed the space from hidden to fulfill some requirement. Is it any thing impact for this.

Please help me to resolve this.

Re: XTEXT Custom Content Assist [message #1804223 is a reply to message #1804221] Wed, 20 March 2019 16:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13149
Registered: July 2009
Senior Member
Hi, is there any reasons you dont use template proposals
can you provide a complete but minimal example/grammar


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XTEXT Custom Content Assist [message #1804262 is a reply to message #1804223] Thu, 21 March 2019 12:54 Go to previous message
Santhiveeran S is currently offline Santhiveeran SFriend
Messages: 7
Registered: November 2018
Junior Member
Thanks a lot Christian!!!! You are rocking.
I changed the approach to template proposals, and it is working as expected.

Instead of creating the sample grammar, I tried to different approach it completes my task.

Thanks for the detailed steps in the below query, it made my work very easy.
https://www.eclipse.org/forums/index.php/t/452900/0/unread/
Previous Topic:Can't get a value from a variable
Next Topic:Referenced versions in xtext-dev-bom
Goto Forum:
  


Current Time: Tue Oct 15 03:32:47 GMT 2019

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

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

Back to the top