Home » Modeling » TMF (Xtext) » semantic quick fixes and commens
|
Re: semantic quick fixes and commens [message #914942 is a reply to message #914941] |
Sun, 16 September 2012 02:53 |
Henrik Lindberg Messages: 2509 Registered: July 2009 |
Senior Member |
|
|
On 2012-16-09 3:15, Henrik Lindberg wrote:
> Hi,
> 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.
>
> e.g
>
> 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.
(Bloody hell...)
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?
- henrik
|
|
|
Re: semantic quick fixes and commens [message #914958 is a reply to message #914941] |
Sun, 16 September 2012 02:53 |
Henrik Lindberg Messages: 2509 Registered: July 2009 |
Senior Member |
|
|
On 2012-16-09 3:15, Henrik Lindberg wrote:
> Hi,
> 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.
>
> e.g
>
> 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.
(Bloody hell...)
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?
- henrik
|
|
|
Re: semantic quick fixes and commens [message #914974 is a reply to message #914941] |
Sun, 16 September 2012 02:53 |
Henrik Lindberg Messages: 2509 Registered: July 2009 |
Senior Member |
|
|
On 2012-16-09 3:15, Henrik Lindberg wrote:
> Hi,
> 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.
>
> e.g
>
> 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.
(Bloody hell...)
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?
- henrik
|
|
| |
Goto Forum:
Current Time: Tue Sep 24 12:48:39 GMT 2024
Powered by FUDForum. Page generated in 0.04406 seconds
|