Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cross reference problem with rename element
Cross reference problem with rename element [message #1802550] Mon, 11 February 2019 18:36 Go to next message
Martin Rud is currently offline Martin RudFriend
Messages: 7
Registered: February 2019
Junior Member
I wrote the following grammar:
Lang: blocks+=(Block)*;

Block: 'begin_block' id=BlockID
       'end_block' ref_id=[BlockID];

BlockID: name=ID;


A simple test file:
begin_block A
end_block A

begin_block A
end_block A


When I select the first A and click on rename element the IDE selects the second and the fourth A (the third A is skipped).
How can I implement rename element to only select the A element which belongs to the right block?
For example, if I select the first A I want to rename only the first and the second A (same for the second block).
Re: Cross reference problem with rename element [message #1802556 is a reply to message #1802550] Mon, 11 February 2019 20:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13181
Registered: July 2009
Senior Member
how does your scoping implementation look like?


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Cross reference problem with rename element [message #1802561 is a reply to message #1802556] Mon, 11 February 2019 22:35 Go to previous messageGo to next message
Martin Rud is currently offline Martin RudFriend
Messages: 7
Registered: February 2019
Junior Member
I didn't provide any scoping implementation.
I'm using the default one.

Could you point me what I need to do in order to solve that problem?

Thanks in advance!
Re: Cross reference problem with rename element [message #1802562 is a reply to message #1802561] Mon, 11 February 2019 22:40 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13181
Registered: July 2009
Senior Member
Simply implement scoping so that the end actually references the start
If you cutler click or f3 the second end you will se it jumps to the first start


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Action for a context menu on XtextEditor
Next Topic:Usage of and(&) operator in grammar rule
Goto Forum:
  


Current Time: Tue Nov 12 03:07:29 GMT 2019

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

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

Back to the top