Open avh4 opened 2 years ago
That might lead to people reporting a “bug” where an extra {-| -}
appears out of the blue. So maybe we have to do this:
module Foo exposing (..)
{-| Module documentation comment inserted by elm-format to avoid an `elm make` bug – see https://somewhere -}
{-| returns 5 -}
foo = 5
Example input:
Current output:
The reason this was done is because
elm make
will use the comment as a module documentation. But this is annoying to people who just want the comment to stay with the definition. I hear confusion about this every year or two.Proposal: A better solution would be to insert an empty module doc, so output would be:
The trigger for this should probably be whether or not the doc comment is on the line immediately above the definition. The comment should be read as the module docs if there is more space between them.