File/Model destroyed after refactoring action [message #1815516] |
Thu, 03 October 2019 15:59  |
Eclipse User |
|
|
|
Hi all,
I have implemented a DSL which allows to 'call' models from other files.
A sample structure looks like this:
file1.dsl:
header file1
call file2
call file3
Every file starts with a header definition just having the file name once again.
If I use Refactor-> Rename Action from the menu, the renaming for the header and callers is performed properly.
In order to update the file name I implemented a RenameStrategy which also updates the filename.
Now I noticed that once I have performed such a renaming action the file, which keeps the calls, cannot be used for open-declaration commands etc. Even if I just use the default renaming features without any injections from my side.
So, if I rename "file2", the code of file1 is updated correctly. But if I change to "file1" in Eclipse and there I click at "call file3" and press F3 (Open declaration).
This doesn't work.
After some debugging and injecting a custom HyperLinkHelper I found that any reference in file1 is now treated as reference to file2.
This causes an exception then because that node doesn't match the offset of the document and the default HyperlinkHelper is crashing.
Is this a known issue or did I miss something in my implementation?
What information is necessary to find a solution for this?
The grammar is just based on commons.terminal.
At the moment I use xText 2.14.
Thank you for your thoughts!
|
|
|
Re: File/Model destroyed after refactoring action [message #1815531 is a reply to message #1815516] |
Fri, 04 October 2019 05:55  |
Eclipse User |
|
|
|
HI all,
I solved the issue in the meantime.
The issue was, that I haven't specified the {ClassName} of the object in the .xtext file.
So my xtext file looks like this now:
Call:
{Call} 'call' called=[FileName]
The previous version looked like this:
Call:
'call' called=[FileName]
|
|
|
Powered by
FUDForum. Page generated in 0.03493 seconds