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

Formatter Breaks Explicit Partial Application Syntax When Split By a Line Break #6948

Closed
LTibbetts opened this issue Aug 12, 2024 · 0 comments · Fixed by #6949
Closed

Formatter Breaks Explicit Partial Application Syntax When Split By a Line Break #6948

LTibbetts opened this issue Aug 12, 2024 · 0 comments · Fixed by #6949
Labels

Comments

@LTibbetts
Copy link

The formatter is applying a trialing comma to the new explicit partial application function syntax which breaks compilation of otherwise compiling code. This only seems to happen when the line length is long enough to force a line break from the formatter.

Unformatted (Compiles)

module LongModuleName = {
  let functionWithAlongNameThatWrapsTheEditorToTheNextLine = (a: int): int =>
    a * 3 + 2
}

let mapWithAReallyLongName = (f: 'a => 'b, a: 'a) => {
  f(a)
}

let functionThatTakesThing =
  mapWithAReallyLongName(
    a => LongModuleName.functionWithAlongNameThatWrapsTheEditorToTheNextLine(a),
    ...
  )

let b = functionThatTakesThing(1)

Formatted (Syntax Error)

module LongModuleName = {
  let functionWithAlongNameThatWrapsTheEditorToTheNextLine = (a: int): int =>
    a * 3 + 2
}

let mapWithAReallyLongName = (f: 'a => 'b, a: 'a) => {
  f(a)
}

let functionThatTakesThing =
  mapWithAReallyLongName(
    a => LongModuleName.functionWithAlongNameThatWrapsTheEditorToTheNextLine(a),
-    ...
+    ...,
  )

let b = functionThatTakesThing(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants