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

Explicit call of active pattern fails #1937

Closed
2 of 3 tasks
dsyme opened this issue Oct 31, 2021 · 1 comment · Fixed by #1938
Closed
2 of 3 tasks

Explicit call of active pattern fails #1937

dsyme opened this issue Oct 31, 2021 · 1 comment · Fixed by #1938

Comments

@dsyme
Copy link
Contributor

dsyme commented Oct 31, 2021

Explicit uses of active patterns as first class values fail, e.g.

StringPosition.(|TrimStart|)

produces

StringPosition.|TrimStart|

https://fsprojects.github.io/fantomas-tools/#/fantomas/preview?data=N4KABGBEDGD2AmBTSAuKBlALgJwJYDsBzABVgGddNdZ8A6ACgB8AVPAWywENtNGBKADrYB%2BSABpwUMokxUiZVGADakiKAgaoAEkwBPAA7I0kApnGqNkLQDdOAGwCuR5Rc0AGCZs2QAkviT4mOi4AF7Inl4QACyuYAC6FgC%2BEWqxVnqGiiaB5pFWto7OKpEQAIwpXpAAspwAHgAyBIj1iESYABa5JaUATG6xCZrJFuqVOgbOkABGsLB2Xd429k6KxSU9Fd7oiGy4cHY0AIKYAKL%2BAPIAZo344bEQl-bSA0kVo4sZkzNzC5ZLhat7mAAMybSzofScaCIABCiEusGwiGI3E4bBkiGwv00OCcLyGbzS40yxm%2B8zB%2BWWRSBUTBEEgEKhsPhiOasAA7pjoJxpH5rLBuVQaNiNLjEPiNMNNO8-p8smSRZSAWg1pEAKx0jCQ6FwhFIgCq%2BkM2G5vPw-MF1FEmsedmekUGksJeWJX1m5KJBRWKqBADZNQztcy9YgAMJ2HlkUM0Mi46CYREih5PcUO14jIly0nuxX-b0uEpgADsAcZOpZSKqOymmKTYFt9q8jogUo0MvprvlOYpeephYAHKWg7rWdGDtagQ3U0309LMxMuz8e16%2ByUAJxDpmHS6YTHRthsTh1sUSlvOsZZqAK5dUwGF0oeIGBpkjpHbXb7YU2lOn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BwzkF1gPIeTR1EPzwZvAhqUd5dyZpoYEtsJEiW5pwKYCDf7c3aOgXQgQ6hOMbDDJK0s05ZFaPAK4t8sC6AQcI7uojg4SLOMk64jjLrYDsJcSAj8wHYQgW-KBpDc4SOPqfDhgQ-Dl04HQyG98YlG1hqnQR4DMleI0MCPuEii5tJLrfMgAkhL%2BAHrGRAB187UxjlFGK%2BAV4lFQpoje2it7uKIdUkRkRgQH1GdwV8iB-FkGgOwAgIUFn6hnjQMS0AIyAyFE3HBGjYn8PiX0ypAzA7eO-hIrAeB4yYKQNEhi3ShiSDiBEEwZAFoUEUC3RIQA

Code

  let (|TrimParagraphLines|) lines =
    lines
    // first remove all whitespace on the beginning of the line
    |> List.map StringPosition.(|TrimStart|)

Result

let (|TrimParagraphLines|) lines =
    lines
    // first remove all whitespace on the beginning of the line
    |> List.map StringPosition.|TrimStart|

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 4.6 branch at 10/31/2021 14:52:39 - 420ef5c

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
Copy link
Contributor

nojaf commented Nov 1, 2021

I was actually hoping to address this in the parser and have the parenthesis inside the syntax tree.
See dotnet/fsharp#11893

nojaf added a commit that referenced this issue Nov 1, 2021
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Nov 2, 2021
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Nov 3, 2021
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Nov 7, 2021
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Nov 9, 2021
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Nov 10, 2021
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Nov 19, 2021
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Nov 24, 2021
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Dec 4, 2021
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Dec 29, 2021
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Jan 7, 2022
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Jan 8, 2022
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Jan 8, 2022
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
nojaf added a commit that referenced this issue Jan 14, 2022
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
@nojaf nojaf closed this as completed in 5496b12 Jan 14, 2022
jindraivanek pushed a commit to jindraivanek/fantomas that referenced this issue Mar 30, 2022
* fix 1937

* fix format

* Use formatSourceString in unit test.

Co-authored-by: nojaf <[email protected]>
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.

2 participants