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?

Regards

- henrik]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

> 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]]>

I would have assumed that

org.eclipse.xtext.serializer.sequencer.HiddenTokenSequencer.getCommentsForEObject(EObject,

INode) can help to get that right, but unfortunately that one is never

called. Neither is the old ICommentAssociator used by the serializer. I

think Moritz or I will come back to that question.

Best regards,

Sebastian

--

Looking for professional support for Xtext, Xtend or Eclipse Modeling?

Go visit: http://xtext.itemis.com

Am 16.09.12 04:53, schrieb Henrik Lindberg:

> 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

>]]>

>

> I would have assumed that

> org.eclipse.xtext.serializer.sequencer.HiddenTokenSequencer.getCommentsForEObject(EObject,

> INode) can help to get that right, but unfortunately that one is never

> called. Neither is the old ICommentAssociator used by the serializer. I

> think Moritz or I will come back to that question.

>

Thanks, I am (naturally ;-)) using the DOM based serializer and CSS

driven formatter that I developed for Geppetto so not too hard to change

the way it works (it already has a number of tweaks compared to the

default).

Meanwhile, if you or Moritz would like to write a line or two about how

it is supposed to work that would help me (i.e. a high level

description). Meanwhile, will take a look at

HiddenTokenSequencer.getCommentsForEObject(...) and see if I can figure

out what it is supposed to do.

Other than the comments, semantic fixes seems to work well with my DOM

based serializer once I figured out an approach to serializing and

formatting the semantic replacements (it is kind of tricky in a language

where the semantic change may alter the formatting, and just inserting

it in raw, one-space-separated form makes it look like a train-wreck...

Wonder why I always get into the difficult stuff two weeks before

planned release...

Regards

- henrik]]>

>> Hi Henrik,

>>

>> I would have assumed that

>> org.eclipse.xtext.serializer.sequencer.HiddenTokenSequencer.getCommentsForEObject(EObject,

>>

>> INode) can help to get that right, but unfortunately that one is never

>> called. Neither is the old ICommentAssociator used by the serializer. I

>> think Moritz or I will come back to that question.

>>

>

> Meanwhile, if you or Moritz would like to write a line or two about how

> it is supposed to work that would help me (i.e. a high level

> description). Meanwhile, will take a look at

> HiddenTokenSequencer.getCommentsForEObject(...) and see if I can figure

> out what it is supposed to do.

>

I looked at getCommensForEObject(EObject, INode), and that was very

straight forward, given an EObject and a node, it just produces a Set of

comments in the tree associated with the semantic object in/under the

given node.

The more interesting issue is - where and how can that be used? If the

semantic model and node model are in sync, the logic that finds

"comments between" is enough.

To solve this a look ahead is required - will all comments match a

"between" slot? If not they need to be associated with EObject. Can't

really wait until that comment is found as it should maybe already have

been emitted.

I was thinking that this could potentially be expensive to perform in

the serializer when doing more agressive semantic modifications, and

maybe this is something that should be done as part of applying a

semantic change (there it is known what changed, the comment nodes can

be found). This is still quite difficult and I wonder if it would be a

good idea to move the responsibility to the user (implementor of

semantic change, or grammar driven) so it can be configured if comments

are left or right associative - or do you think there is a general rule

that always works?

Regards

- henrik]]>