Closed lydell closed 1 year ago
Yeah, this is unfortunate, but it's really hard to handle comments at the moment, and I don't know of a design that would make comments work out better.
I see 3 ways of improving this:
elm-syntax
better attach the comments to the AST. Unfortunately I have no clue how this could be achieved, or what "better attached" would mean in practice.elm-review
report a warning whenever it notices that comments have changed after a fix, and show that in the fix prompt.Blue500
to Element.Font.underline
by [
, and we could try to only replace ::
, which may help with this case. But elm-syntax
doesn't currently provide the range information about the operator, hence why this removes more than necessary.In the meantime, this is what the fix prompt is for, so that you can re-add the comment or apply the fix manually yourself. So I'm happy that you were able to figure this out (at some point in the prompt or in the git diff
). I would love to solve it, but even the easiest solution would require a major version of elm-syntax
(which we will focus on one day).
The rule simplifed some list code:
But I lost that
-- This class is used in app.ts.
comment.Thoughts?