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

Equals sign should only be on same line if last tuple is multiline #3040

Closed
4 tasks
nojaf opened this issue Jan 31, 2024 · 2 comments · Fixed by #3042
Closed
4 tasks

Equals sign should only be on same line if last tuple is multiline #3040

nojaf opened this issue Jan 31, 2024 · 2 comments · Fixed by #3042

Comments

@nojaf
Copy link
Contributor

nojaf commented Jan 31, 2024

Issue created from fantomas-online

Code

    let processSnippetLine
        (checkResults: FSharpCheckFileResults)
        (semanticRanges: SemanticClassificationItem array)
        (lines: string array)
        (line: int, lineTokens: SnippetLine)
        =
        let lineStr = lines.[line]
        ()

Result

let processSnippetLine
    (checkResults: FSharpCheckFileResults)
    (semanticRanges: SemanticClassificationItem array)
    (lines: string array)
    (line: int, lineTokens: SnippetLine) =
    let lineStr = lines.[line]
    ()

Problem description

Related to the changes of #3038.
The = jump to the same line as the style guide suggests this for multiline tuples:

let a
    (
        b: c,
        d: e
    ) =
    f

If the last tuple isn't multiline we probably shouldn't go for this.
Thoughts @josh-degraw @dawedawe?

Extra information

  • The formatted result breaks my code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.
  • I would like a release if this problem is solved.

Options

Fantomas main branch at 1/1/1990

Default Fantomas configuration

Did you know that you can ignore files when formatting by using a .fantomasignore file?
PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.

@josh-degraw
Copy link
Contributor

Yeah I feel like definitely should only apply for multiline ones.

@dawedawe
Copy link
Member

dawedawe commented Feb 1, 2024

What Josh said.

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

Successfully merging a pull request may close this issue.

3 participants