You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So synthetic methods have the coordinates of the last real method of the class. This makes sense, but this may break some assumptions we make on line/column positions. Namely that if a node is-before another in a prefix traversal of the tree, then their positions are also <=. The designer relies on this for instance.
(I think those assumptions are already broken by the apex module anyway, because the designer's node finding methods malfunction)
Maybe we should move those synthetic nodes around when we do the traversal that resolve text coordinates (though since it's already broken we could do that later).
I'd prefer to do that later. It would be useful to have an explicit test for the condition that the positions of a node is always <= than the position of the next node. Don't we have some test like that in pmd7?
About reordering the nodes: Not sure if we should do that. Currently I think, we use the visit order of the apex jorje parser.
So maybe we should make sure, that the condition is true no matter where the synthetic methods are. That means, we would place them just after the previous (real) sibling and before the next (real) sibling, if there is a next.
If we have a test, we could ensure this conditions in other languages as well.
The text was updated successfully, but these errors were encountered:
Follow-up on #3156
So synthetic methods have the coordinates of the last real method of the class. This makes sense, but this may break some assumptions we make on line/column positions. Namely that if a node is-before another in a prefix traversal of the tree, then their positions are also
<=
. The designer relies on this for instance.(I think those assumptions are already broken by the apex module anyway, because the designer's node finding methods malfunction)
Maybe we should move those synthetic nodes around when we do the traversal that resolve text coordinates (though since it's already broken we could do that later).
Originally posted by @oowekyala in #3156 (comment)
I'd prefer to do that later. It would be useful to have an explicit test for the condition that the positions of a node is always <= than the position of the next node. Don't we have some test like that in pmd7?
About reordering the nodes: Not sure if we should do that. Currently I think, we use the visit order of the apex jorje parser.
So maybe we should make sure, that the condition is true no matter where the synthetic methods are. That means, we would place them just after the previous (real) sibling and before the next (real) sibling, if there is a next.
If we have a test, we could ensure this conditions in other languages as well.
The text was updated successfully, but these errors were encountered: