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

Don't add newlines to short partial applications #1701

Merged
merged 2 commits into from
May 7, 2021
Merged

Don't add newlines to short partial applications #1701

merged 2 commits into from
May 7, 2021

Conversation

pbiggar
Copy link
Contributor

@pbiggar pbiggar commented May 6, 2021

Fixes #1700

@nojaf
Copy link
Contributor

nojaf commented May 6, 2021

@pbiggar thank you for this contribution.
Did you ran the Format command?
dotnet fake run build.fsd -t Format, that might be missing from the contribution guidelines thought...

@pbiggar
Copy link
Contributor Author

pbiggar commented May 6, 2021

I see the test failures, working on them.

(Note, the tests don't succeed locally for me on OSX with the error below)


dotnet test
  Determining projects to restore...
  All projects are up-to-date for restore.
  Fantomas -> /Users/paulbiggar/projects/fantomas/src/Fantomas/bin/Debug/netstandard2.0/Fantomas.dll
  Fantomas.Extras -> /Users/paulbiggar/projects/fantomas/src/Fantomas.Extras/bin/Debug/netstandard2.0/Fantomas.Extras.dll
  Fantomas.CoreGlobalTool -> /Users/paulbiggar/projects/fantomas/src/Fantomas.CoreGlobalTool/bin/Debug/netcoreapp3.1/fantomas-tool.dll
  Fantomas.Tests -> /Users/paulbiggar/projects/fantomas/src/Fantomas.Tests/bin/Debug/net5.0/Fantomas.Tests.dll
Test run for /Users/paulbiggar/projects/fantomas/src/Fantomas.Tests/bin/Debug/net5.0/Fantomas.Tests.dll (.NETCoreApp,Version=v5.0)
Microsoft (R) Test Execution Command Line Tool Version 16.8.3-dev+212656d7b384a506aa714999f678b3ace82d114e
Copyright (c) Microsoft Corporation.  All rights reserved.

  Fantomas.CoreGlobalTool.Tests -> /Users/paulbiggar/projects/fantomas/src/Fantomas.CoreGlobalTool.Tests/bin/Debug/net5.0/Fantomas.CoreGlobalTool.Tests.dll
Starting test execution, please wait...
Test run for /Users/paulbiggar/projects/fantomas/src/Fantomas.CoreGlobalTool.Tests/bin/Debug/net5.0/Fantomas.CoreGlobalTool.Tests.dll (.NETCoreApp,Version=v5.0)
A total of 1 test files matched the specified pattern.
Microsoft (R) Test Execution Command Line Tool Version 16.8.3-dev+212656d7b384a506aa714999f678b3ace82d114e
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
The active test run was aborted. Reason: Test host process crashed : Stack overflow.
   at Fantomas.AstTransformer+Ast+visit@95-4.Invoke(SynExpr, Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>,Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>>)
   at Fantomas.Continuation.sequence[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>,System.__Canon>>, Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>,System.__Canon>)
   at Fantomas.AstTransformer+Ast+visit@95-4.Invoke(SynExpr, Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>,Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>>)
   at Fantomas.AstTransformer+Ast+visit@284-33.Invoke(Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>)
   at Fantomas.AstTransformer+Ast+finalContinuation@311-22.Invoke(Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>>)
   at Fantomas.Continuation+sequence@171-1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Fantomas.Continuation+sequence@171-1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Fantomas.Continuation+sequence@171-1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Fantomas.Continuation.sequence[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>,System.__Canon>>, Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>,System.__Canon>)
   at Fantomas.Continuation+sequence@171[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(System.__Canon)
   at Fantomas.AstTransformer+Ast+visit@284-34.Invoke(Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>)
   at Fantomas.AstTransformer+Ast+visit@340-35.Invoke(Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>)
   at Fantomas.AstTransformer+Ast+finalContinuation@239-16.Invoke(Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>>)
   at Fantomas.Continuation+sequence@171-1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Fantomas.Continuation+sequence@171-1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Fantomas.Continuation.sequence[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>,System.__Canon>>, Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>,System.__Canon>)
   at Fantomas.Continuation+sequence@171[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(System.__Canon)
   at Fantomas.AstTransformer+Ast+visit@99-5.Invoke(Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>)
   at Fantomas.AstTransformer+Ast+visit@375-38.Invoke(Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>)
   at Fantomas.AstTransformer+Ast+visit@95-4.Invoke(SynExpr, Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>,Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>>)
   at Fantomas.Continuation.sequence[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>,System.__Canon>>, Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>,System.__Canon>)
   at Fantomas.Continuation+sequence@171[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(System.__Canon)
   at Fantomas.AstTransformer+Ast+visit@95-4.Invoke(SynExpr, Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>,Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>>)
   at Fantomas.Continuation.sequence[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>,System.__Canon>>, Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>,System.__Canon>)
   at Fantomas.AstTransformer+Ast+visit@95-4.Invoke(SynExpr, Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>,Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>>)
   at Fantomas.AstTransformer+Ast+visit@284-33.Invoke(Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>)
   at Fantomas.AstTransformer+Ast+finalContinuation@239-16.Invoke(Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Collections.FSharpList`1<TriviaNodeAssigner>>)
   at Fantomas.Continuation+sequence@171-1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Fantomas.Continuation+sequence@171-1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Fantomas.Continuation.sequence[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Cultu

Passed!  - Failed:     0, Passed:     7, Skipped:     0, Total:     7, Duration: 4 s - /Users/paulbiggar/projects/fantomas/src/Fantomas.Tests/bin/Debug/net5.0/Fantomas.Tests.dll (net5.0)
Test Run Aborted.

Passed!  - Failed:     0, Passed:    19, Skipped:     0, Total:    19, Duration: 13 s - /Users/paulbiggar/projects/fantomas/src/Fantomas.CoreGlobalTool.Tests/bin/Debug/net5.0/Fantomas.CoreGlobalTool.Tests.dll (net5.0)

@pbiggar
Copy link
Contributor Author

pbiggar commented May 6, 2021

@pbiggar thank you for this contribution.
Did you ran the Format command?
dotnet fake run build.fsd -t Format, that might be missing from the contribution guidelines thought...

Thanks, I caught it in the CI logs. I'll add that command to the contributor docs in my other PR.

@nojaf
Copy link
Contributor

nojaf commented May 6, 2021

Could you try dotnet test -c Release?
I never had this problem on Windows, perhaps some more tests need the #if RELEASE like in

@pbiggar
Copy link
Contributor Author

pbiggar commented May 7, 2021

This should be working now.

Copy link
Contributor

@nojaf nojaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you for this PR!

@nojaf nojaf enabled auto-merge (squash) May 7, 2021 07:23
@nojaf nojaf merged commit 61c4d5b into fsprojects:master May 7, 2021
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 this pull request may close these issues.

Currying a pair gets spread over multiple lines
2 participants