Skip to content

Commit

Permalink
Initial settings for strousrup bracket style (#2161)
Browse files Browse the repository at this point in the history
* Bare minimal changes for one test case.

* Initial draft of ragnarok feature.

* Add more syntax node where the case occurs.

* Maybe multiline strings?

* Highlight additional cases in SynBinding.

* Add new setting for ragnarok mode.
Take anonymous records in SynBinding into account.

* Separate test case into multiple files. Implement SynBindingFunction and Expressions.

* Add support for computation expressions.

* Add support for Array/List in SynBinding value/function.

* Exclude update records.

* Synbinding function with return type.

* Add additional tests for type members.

* Add LetOrUseBang with Expression.

* Add YieldOrReturn with Expression.

* Add YieldOrReturnBang with Expression.

* Add SynExprAndBang with Expression.

* Format test files.

* Add tests suffix

* Add LongIdentSetExpression with Expression.

* Add DotIndexedSet with Expression.

* Add Set with Expression.

* Add DotSet with Expression.

* Add Lambda with Expression.

* Add SynMatchClause with Expression.

* Add SynTypeDefnSimpleRepr.Record NOTE: TESTS FAIL

* Add SynTypeDefnSigRepr.Simple

* Use correct helper function for Set and DotSet.

* Work around edge case where match clause body needs to be further indented.

* Add named arguments in application and new expressions.

* Fix leftover issue

* Add TODO comment

* Fix failing test

* Format files

Co-authored-by: nojaf <florian.verdonck@outlook.com>
  • Loading branch information
josh-degraw and nojaf committed Mar 30, 2022
1 parent 8f2ab14 commit 0f86ecd
Show file tree
Hide file tree
Showing 26 changed files with 7,262 additions and 76 deletions.
544 changes: 544 additions & 0 deletions docs/ragnarok.md

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions src/Fantomas.Tests/Fantomas.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,25 @@
<Compile Include="InsertFinalNewlineTests.fs" />
<Compile Include="SingleExprTests.fs" />
<Compile Include="IgnoreFileTests.fs" />
<Compile Include="Ragnarok\SynBindingValueExpressionTests.fs" />
<Compile Include="Ragnarok\SynBindingFunctionExpressionTests.fs" />
<Compile Include="Ragnarok\SynBindingFunctionLongPatternExpressionTests.fs" />
<Compile Include="Ragnarok\SynBindingFunctionWithReturnTypeExpressionTests.fs" />
<Compile Include="Ragnarok\LetOrUseBangExpressionTests.fs" />
<Compile Include="Ragnarok\YieldOrReturnExpressionTests.fs" />
<Compile Include="Ragnarok\YieldOrReturnBangExpressionTests.fs" />
<Compile Include="Ragnarok\SynExprAndBangExpressionTests.fs" />
<Compile Include="Ragnarok\LongIdentSetExpressionTests.fs" />
<Compile Include="Ragnarok\DotIndexedSetExpressionTests.fs" />
<Compile Include="Ragnarok\SetExpressionTests.fs" />
<Compile Include="Ragnarok\DotSetExpressionTests.fs" />
<Compile Include="Ragnarok\LambdaExpressionTests.fs" />
<Compile Include="Ragnarok\MultiLineLambdaClosingNewlineExpressionTests.fs" />
<Compile Include="Ragnarok\SynMatchClauseExpressionTests.fs" />
<Compile Include="Ragnarok\KeepIndentInBranchExpressionTests.fs" />
<Compile Include="Ragnarok\SynTypeDefnSimpleReprRecordTests.fs" />
<Compile Include="Ragnarok\SynTypeDefnSigReprSimpleTests.fs" />
<Compile Include="Ragnarok\NamedArgumentExpressionTests.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Fantomas.Extras\Fantomas.Extras.fsproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ let ``no extra newline after record type with no members`` () =
To : float
Name: string }
"""
config
{ config with MaxRecordWidth = 39 }
|> prepend newline
|> should
equal
Expand Down
Loading

0 comments on commit 0f86ecd

Please sign in to comment.