Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » reference but in content assist(make content assist)
reference but in content assist [message #762307] Wed, 07 December 2011 21:19 Go to next message
Mokhtar Alshubei is currently offline Mokhtar AlshubeiFriend
Messages: 121
Registered: November 2011
Location: Germany
Senior Member
Hi,

Is it possible to let content assist list all pre-entered instances of some rule?
because cross reference restricts me Mad

Regards,
Mokhtar
Re: reference but in content assist [message #762310 is a reply to message #762307] Wed, 07 December 2011 21:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

i do not understand this can you elaborate a bit on this? basically "everything" is possible in CA.

~Christian


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

[Updated on: Wed, 07 December 2011 21:26]

Report message to a moderator

Re: reference but in content assist [message #762313 is a reply to message #762310] Wed, 07 December 2011 21:34 Go to previous messageGo to next message
Mokhtar Alshubei is currently offline Mokhtar AlshubeiFriend
Messages: 121
Registered: November 2011
Location: Germany
Senior Member
Thank you!
in my editor out of my DSL i want if user presses Ctrl space she gets a list of some element instances as if it was defined as cross reference.
reason is cross reference ref = [MyRule] asks exactly identical instances of MyRule whereas i need to show part of MyRule features.
If you would say okay reference that part, i would say it is complicated to specify its Qname.

Regards, Mokhtar
Re: reference but in content assist [message #762315 is a reply to message #762313] Wed, 07 December 2011 21:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Still dont get the problem. why dont you simply adopt the default content assist? the are complete* methods in the abstract proposal provider generated for your language. it lets you access the current model so it should be easy for you to collect your information there? if not please share a specific grammar and the wished assist.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: reference but in content assist [message #762318 is a reply to message #762315] Wed, 07 December 2011 21:47 Go to previous messageGo to next message
Mokhtar Alshubei is currently offline Mokhtar AlshubeiFriend
Messages: 121
Registered: November 2011
Location: Germany
Senior Member
Given this demo grammar: (just demmo not my real one)

Model: elements+=Elements*
Element: Person|FriendShip;
Person: 'person' name=ID 'from' country=ID ;
FreindShip:person=[Person] 'is friend with' freind=[Person] ;

okay given this valid input:

person Mokhtar from "Yemen"
person Christian from "Holand"

Mokhtar is friend with Christian
My Question: can one in CA collect the persons and countries defined above and list them without using that cross-reference?
i.e the rule would be:
FriendShip: person= Person 'is friend with' friend = Person;
Thank you so much,
Mokhtar
Re: reference but in content assist [message #762320 is a reply to message #762318] Wed, 07 December 2011 21:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
yes.FriendShip: person= ID 'is friend with' friend = ID;

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

[Updated on: Wed, 07 December 2011 21:51]

Report message to a moderator

Re: reference but in content assist [message #762322 is a reply to message #762320] Wed, 07 December 2011 21:54 Go to previous messageGo to next message
Mokhtar Alshubei is currently offline Mokhtar AlshubeiFriend
Messages: 121
Registered: November 2011
Location: Germany
Senior Member
exactly i wanted actually to quick-reply myself that my input is not valid and the new introduced rule was not appropriat but we got the question correct and thank you for the help.
Mokhtar
Re: reference but in content assist [message #762363 is a reply to message #762322] Thu, 08 December 2011 00:01 Go to previous messageGo to next message
Mokhtar Alshubei is currently offline Mokhtar AlshubeiFriend
Messages: 121
Registered: November 2011
Location: Germany
Senior Member
can you please tell me what is the advantage of using the reference over content assist when both would do the same? is it like reference in grammar level is faster than in java code level in case there are lots of referenced items?
thank you
Mokhtar
Re: reference but in content assist [message #762389 is a reply to message #762363] Thu, 08 December 2011 01:08 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi, what about linking, validation, having references in the
generated in the model instead of a string. Noone would prefer a
string over a real ref


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Selectively adding actions to Outline popup menu
Next Topic:Accessing Warnings associated with a DSL element
Goto Forum:
  


Current Time: Fri Mar 29 02:39:51 GMT 2024

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

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

Back to the top