We have noticed an inadequate behavior with respect to how comment annotations are generated for import sections. Indeed, it's rather counter-intuitive, for example:
Here, contrary to what a programmer could have meant, -- (1) is saved in the annotation for import Bar, while -- (2) is saved in annotation for import Baz. import Foo doesn't have any comments associated with it, while -- (3) is a comment attached to the entire module.
One could see how wrong this is if we try to do any sort of meaningful transformation on parsed source, such as reordering of imports. Indeed, as simple as it seems, this cannot be done in a satisfactory fashion unless we manage to reassign comments somehow.
We have noticed an inadequate behavior with respect to how comment annotations are generated for import sections. Indeed, it's rather counter-intuitive, for example:
Here, contrary to what a programmer could have meant,
-- (1)
is saved in the annotation forimport Bar
, while-- (2)
is saved in annotation forimport Baz
.import Foo
doesn't have any comments associated with it, while-- (3)
is a comment attached to the entire module.One could see how wrong this is if we try to do any sort of meaningful transformation on parsed source, such as reordering of imports. Indeed, as simple as it seems, this cannot be done in a satisfactory fashion unless we manage to reassign comments somehow.
Currently we get: