|Re: semantic quick fixes and commens [message #914614 is a reply to message #914613]
||Sun, 16 September 2012 02:53
| Henrik Lindberg
Registered: July 2009
On 2012-16-09 3:15, Henrik Lindberg wrote:|
> I am trying to use semantic modifications in quick fixes, and I have a
> hard time figuring out where comments are reconciled.
> I am performing an EMF 'move' operation on a list, and as a result all
> comments disappear except one, but this comment is in the wrong place.
> x => 1, // a
> y => 2, // b
> z => 3 // c
> If I move the y => 2 to position 1 the end result is something like
> y => 2,
> x => 1, // b
> z => 3
> Where is the logic that reconciles the comments?
I think I can answer this myself... there is no special place, simply
serializing a model with an existing INode model.
First, my example had a typo. It should have been:
y => 2,
x => 1, // b
z => 3 // c
i.e. that the first comment disappears, and the remaining comments stay
grammatically where they were (i.e. between index 1 and 2, and between 3
and what follows.
The first comment disappears because at the point where it "should have
been found" the serializer is looking for comments between index 0 and
1, the the old comment is simply not there it was between the old 2 and 3.
Seems incredibly complex to figure out how to get the comments to move
with the moved object and to make sure the dangling comment appears
where a human expects it to appear.
Any tips? Has someone written something similar?
Powered by FUDForum
. Page generated in 0.01508 seconds