Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gren Format command removes multiline comments, format also moves comments away from documented code #244

Open
MaeBrooks opened this issue Apr 27, 2024 · 1 comment

Comments

@MaeBrooks
Copy link

When running the gren format <file path> command:

  • Single comments will be moved away from code they are directly above
  • Multiline comments following the same practice as shown in the core code will be removed
  • Multiline comments will be moved away from code they are directly above

Comment blocks written like:

{-| appends new line character
  Some more info I deem important
-}
appendNewLine : String -> String
appendNewLine input =
    input ++ "\n"

Will be formatted to:

appendNewLine : String -> String
appendNewLine input =
    input ++ "\n"

Comment blocks without the | will be moved instead of removed like so:

{- appends new line character

  Hello World
-}
appendNewLine : String -> String
appendNewLine input =
    input ++ "\n"

Will be formatted to:

{- appends new line character

  Hello World
  -}


appendNewLine : String -> String
appendNewLine input =
    input ++ "\n"

Single Line comments will be moved away and above code

-- appends new line character
appendNewLine : String -> String
appendNewLine input =
    input ++ "\n"

Will be formatted to:

-- appends new line character


appendNewLine : String -> String
appendNewLine input =
    input ++ "\n"
@robinheghan
Copy link
Member

Thank you for reporting this.

The person who contributed the formatter suddenly stopped working on it, and it hasn't seen activity in a while.

I fully expect to re-write the parser with gren-in-gren, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants