Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Content Assist for Hidden Terminal Rules(How to control the content assist for hidden terminal rules)
Content Assist for Hidden Terminal Rules [message #1804128] Tue, 19 March 2019 06:26 Go to next message
Virag Purnam is currently offline Virag PurnamFriend
Messages: 142
Registered: June 2014
Senior Member
Hi,

I would like to restrict the content assist for hidden terminal rules.
I have constructed a small xtext project.

Grammar:
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals hidden(WS, ML_COMMENT, SL_COMMENT, TEST_STMT)

generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"

Model:
	conts+=Cont* procs+=Proc*;
	
Cont:
	'Cont' name=ID '{' items+=Item* '}' ;

Item: 'Item' name=ID;


Proc:
	'Link' item1=[Item|ID] 'OF' con1=[Cont|ID] 'TO' item2=[Item|ID] 'OF' con2=[Cont|ID]
;

//Test  statement
terminal TEST_STMT :  'FreeText: ' ->  '.';


Model File:
Cont container1 {	
	FreeText: We can write here .
	// Test
	Item item1
}

Cont container2 {
	Item item2
}  

Link item1 OF container1 TO item2 OF container2   


Problem is when we try content assist after 'FreeText: ', it suggest 'Item'. I want content assist not to show anything until '.'.
How can we achieve this?
Looking for some suggestion.

I have attached an image also.

Thanks and regards,
Virag Purnam
Re: Content Assist for Hidden Terminal Rules [message #1804129 is a reply to message #1804128] Tue, 19 March 2019 06:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
simply override the complete method does not work?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 19 March 2019 06:36]

Report message to a moderator

Re: Content Assist for Hidden Terminal Rules [message #1804134 is a reply to message #1804129] Tue, 19 March 2019 07:55 Go to previous messageGo to next message
Virag Purnam is currently offline Virag PurnamFriend
Messages: 142
Registered: June 2014
Senior Member
Hi Mr. Christian Dietrich,

I tried to debug by keeping breakpoint there.
But it never hit that breakpoint.
What can be the issue?

Thanks and regards,
Virag Purnam
Re: Content Assist for Hidden Terminal Rules [message #1804136 is a reply to message #1804134] Tue, 19 March 2019 08:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
ahhh i got your question wrong.
you may have a look at what xtend does for javadoc proposals but thats not trivial




Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Content Assist for Hidden Terminal Rules [message #1804147 is a reply to message #1804136] Tue, 19 March 2019 09:52 Go to previous message
Virag Purnam is currently offline Virag PurnamFriend
Messages: 142
Registered: June 2014
Senior Member
Ok.. I will check that.

Thanks and regards,
Virag Purnam
Previous Topic:Custom TemplateNewFileWizard
Next Topic:Can't get a value from a variable
Goto Forum:
  


Current Time: Fri Apr 19 15:06:28 GMT 2024

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

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

Back to the top