|
Re: Preserving single and mult-line comments from separate editor when an EObject is deleted [message #659983 is a reply to message #659975] |
Wed, 16 March 2011 13:45 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
As you're already talking about the node model, I guess you figured out
how to extract the comment (it's a leaf node with isHidden()==true)
You should not modify the node model, this should always be oly the
parser's task. Better remember the offset of the comment and restore
them at the same position after the serializer has done its work.
Am 16.03.11 14:07, schrieb Drew:
> Our grammar defines C++ style single and multiline comments // , /* */ .
> While performing certain operations on the emf items in our non-text
> based editor (deleting the EMF EObject), the comments associated with
> the deleted EObject also gets removed as well. I guess what I am looking
> for is a way to extract these from the current node associated with the
> EObject, and them and place them back at a node near the one that is
> removed.
>
> 1) Step 1 extract the comment(s) for a given EMF element
> 2) Step 2 find a node near the one being deleted
> 3) Step 3 place the extracted comments on the nearest node.
>
>
> /* This gets removed if I delete myFoo, maybe this is a comment for the
> entire file that I want to keep */
> create myFoo; // this also gets removed
>
> create myBar;
>
> create myFooBar;
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
Powered by
FUDForum. Page generated in 0.03090 seconds