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

TypedApp should not have a space when chained. #1447

Closed
1 of 3 tasks
nojaf opened this issue Feb 12, 2021 · 1 comment · Fixed by #1449
Closed
1 of 3 tasks

TypedApp should not have a space when chained. #1447

nojaf opened this issue Feb 12, 2021 · 1 comment · Fixed by #1449

Comments

@nojaf
Copy link
Contributor

nojaf commented Feb 12, 2021

Issue created from fantomas-online

Code

let x =
                        LoggerConfiguration<Foo>("host", Environment.MachineName)
                            .Enrich.WithProperty<Bar>("user", Environment.UserName)
                            .Enrich.WithProperty ("application", context.HostingEnvironment.ApplicationName)

Error

Fantomas was able to format the code but the result appears to have errors:
- Successive arguments should be separated by spaces or tupled, and arguments involving function or method applications should be parenthesized
Please open an issue.

Formatted result:

let x =
    LoggerConfiguration<Foo> ("host", Environment.MachineName)
        .Enrich.WithProperty<Bar>("user", Environment.UserName)
        .Enrich.WithProperty ("application", context.HostingEnvironment.ApplicationName)

Problem description

Please describe here the Fantomas problem you encountered.
Check out our Contribution Guidelines.

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 02/12/2021 08:36:55 - fe5141a

    { config with
                SpaceBeforeUppercaseInvocation = true
                SpaceBeforeMember = true }

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

@nojaf
Copy link
Contributor Author

nojaf commented Feb 12, 2021

Other sample:

Log.Logger <-
    LoggerConfiguration<Foo>()
        .Destructure.FSharpTypes()
        .WriteTo.Console()
        .CreateLogger()

nojaf added a commit that referenced this issue Feb 12, 2021
* SynExpr.TypeApp inside DotGet chain should not have space before. Fixes #1447.

* Respect SpaceBeforeUppercaseInvocation when application is last in DotGet chain. Fixes #1448.
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.

1 participant