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

Multiline when condition in pattern match needs to be further indented #1320

Closed
3 tasks
nojaf opened this issue Dec 22, 2020 · 0 comments · Fixed by #1322
Closed
3 tasks

Multiline when condition in pattern match needs to be further indented #1320

nojaf opened this issue Dec 22, 2020 · 0 comments · Fixed by #1322

Comments

@nojaf
Copy link
Contributor

nojaf commented Dec 22, 2020

Issue created from fantomas-online

Code

module Foo =
    module Bar =
            let buildUsage argInfos =
                match v.IsMember, v.IsInstanceMember, v.LogicalName, v.DisplayName with
                // Ordinary functions or values
                | false, _, _, name when
                    not (hasAttribute<RequireQualifiedAccessAttribute> v.ApparentEnclosingEntity.Attributes) ->
                    name + " " + parArgs
                // Ordinary static members or things (?) that require fully qualified access
                | _, _, _, name -> name + parArgs

Result

module Foo =
    module Bar =
        let buildUsage argInfos =
            match v.IsMember, v.IsInstanceMember, v.LogicalName, v.DisplayName with
            // Ordinary functions or values
            | false, _, _, name when not (
                hasAttribute<RequireQualifiedAccessAttribute> v.ApparentEnclosingEntity.Attributes
              ) -> name + " " + parArgs
            // Ordinary static members or things (?) that require fully qualified access
            | _, _, _, name -> name + parArgs

Problem description

hasAttribute needs to be further indented.

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas Master at 12/22/2020 20:24:38 - 88235c3

Default Fantomas configuration

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

nojaf added a commit to nojaf/fantomas that referenced this issue Dec 22, 2020
nojaf added a commit that referenced this issue Dec 22, 2020
…1323)

* Put multiline when condition on the next line. Fixes #1320.

* Correct indentation of clause body if when condition is multiline.
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 a pull request may close this issue.

1 participant