Skip to content

Conversation

@JQuezada0
Copy link

Once the number of input types grows to a point where concatenating them with a comma and a space causes the line to exceed 65535 characters, elm will fail to parse the file.

This change uses softlines from the elm-pretty-printer package to break up the exposes list as needed, but it prefers one line if possible.

"name": "mdgriffith/elm-codegen",
"summary": "A code generation library for Elm",
"license": "BSD-3-Clause",
"version": "4.2.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, you should never bump the package version in a PR, unless you're the author

@@ -1,6 +1,6 @@
{
"name": "elm-codegen",
"version": "0.5.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Samewise

Comment on lines +361 to +369
renderedWithSeparator =
case List.reverse renderedTopLevelExposes of
head :: tail ->
head
:: List.map (Pretty.a <| Pretty.char ',') tail
|> List.reverse

_ ->
renderedTopLevelExposes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed or would softlines just work on the result of Pretty.join?

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

Successfully merging this pull request may close these issues.

2 participants