Skip to content

Commit

Permalink
More signature files (#2678)
Browse files Browse the repository at this point in the history
* Add signature file for Context.fsi. Remove unused code.

* Add signature file for Utils.fs

* Add signature file for ISourceTextExtensions.fs

* Add signature file for RangeHelpers.fs

* Add signature file for Validation.fs

* Duplicate normalizeNewLine 😅
  • Loading branch information
nojaf authored Jan 2, 2023
1 parent da3463f commit 96a5b7a
Show file tree
Hide file tree
Showing 14 changed files with 375 additions and 299 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Some common use cases include:
<PackageProjectUrl>https://fsprojects.github.io/fantomas/</PackageProjectUrl>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<WarningsAsErrors>FS0025</WarningsAsErrors>
<WarnOn>3390;$(WarnOn)</WarnOn>
<WarningsAsErrors>FS0025;FS1182</WarningsAsErrors>
<WarnOn>1182;3390;$(WarnOn)</WarnOn>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode>true</RestoreLockedMode>
<NoWarn>NU1603</NoWarn>
Expand Down
10 changes: 3 additions & 7 deletions src/Fantomas.Core.Tests/ContextTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,14 @@ let ``nested exceedsMultiline expression should bubble up to parent check`` () =
let expression =
!- "let a ="
+> autoIndentAndNlnIfExpressionExceedsPageWidth (
sepOpenA
+> expressionFitsOnRestOfLine
expressionFitsOnRestOfLine
// short expression, should cross the max page width of 50
(!- "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" +> !- "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB")
// fallback expression
(sepNln
+> !- "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
(!- "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+> sepNln
+> !- "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
+> sepNln)
+> sepCloseA
)

let config =
Expand All @@ -119,7 +116,6 @@ let ``nested exceedsMultiline expression should bubble up to parent check`` () =
equal
"""
let a =
[|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
|]"""
"""
7 changes: 7 additions & 0 deletions src/Fantomas.Core.Tests/TestHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ open Fantomas.Core
[<assembly: Parallelizable(ParallelScope.All)>]
do ()

[<RequireQualifiedAccess>]
module String =
let normalizeNewLine (str: string) =
str.Replace("\r\n", "\n").Replace("\r", "\n")

let normalizeThenSplitNewLine (str: string) = (normalizeNewLine str).Split('\n')

let config = FormatConfig.Default
let newline = "\n"

Expand Down
Loading

0 comments on commit 96a5b7a

Please sign in to comment.