Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How can i scope Strings or IDs?
How can i scope Strings or IDs? [message #1753273] Fri, 03 February 2017 09:41 Go to next message
Simon BBBBBBB is currently offline Simon BBBBBBBFriend
Messages: 63
Registered: March 2015
Member
Hello there,

in my grammar i have a path that looks like this:

attribute=ID

i want to scope the possible IDs in the same way i can do it with references.

How can i achieve this?
Re: How can i scope Strings or IDs? [message #1753274 is a reply to message #1753273] Fri, 03 February 2017 09:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
can you please elaborate what you mean by that?

you can add validations and adapt content assist if this is what you mean.
or introduce an enum


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: How can i scope Strings or IDs? [message #1753276 is a reply to message #1753273] Fri, 03 February 2017 09:45 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Make sure that the referrable elements are in the index and use cross references to the elements you want to refer to:
attribute=[Attribute|ID]
Depending on your use case you have to customize your IScopeProvider and/or IQualifiedNameProvider.
Re: How can i scope Strings or IDs? [message #1753277 is a reply to message #1753276] Fri, 03 February 2017 09:50 Go to previous messageGo to next message
Simon BBBBBBB is currently offline Simon BBBBBBBFriend
Messages: 63
Registered: March 2015
Member
@Karsten: thx for your answer but i cant use a reference.

@Christian: Thx for your answer too. that sounds what i want to do, where should i start?
Re: How can i scope Strings or IDs? [message #1753278 is a reply to message #1753277] Fri, 03 February 2017 10:02 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
MyDslValidator => see greeting example and MyDslProposalProvider => there should be "complete_XXXX and completeXXXX_yyyy" methods in the superclass you can override

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: How can i scope Strings or IDs? [message #1753284 is a reply to message #1753278] Fri, 03 February 2017 10:16 Go to previous message
Simon BBBBBBB is currently offline Simon BBBBBBBFriend
Messages: 63
Registered: March 2015
Member
That was easy. thank you christian.
Previous Topic:[SOLVED] Where is FormatterTestHelper?
Next Topic:Mutliline string concatenation
Goto Forum:
  


Current Time: Thu Dec 26 11:23:39 GMT 2024

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

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

Back to the top