-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Indent cramped record field body if indent_size is low. (#2802)
* Indent cramped record field body if indent_size is low. * Correct range of inherit keyword and inherit expression. * Correctly indent multiline fields in inherit expression. * Add changelog entry. * Add new version.
- Loading branch information
Showing
7 changed files
with
334 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
module Fantomas.Core.Tests.Stroustrup.RecordInstanceTests | ||
|
||
open NUnit.Framework | ||
open FsUnit | ||
open Fantomas.Core.Tests.TestHelper | ||
open Fantomas.Core | ||
|
||
let config = | ||
{ config with | ||
MultilineBracketStyle = Stroustrup } | ||
|
||
[<Test>] | ||
let ``multiline field body expression where indent_size = 2`` () = | ||
formatSourceString | ||
false | ||
""" | ||
let handlerFormattedRangeDoc (lines: NamedText, formatted: string, range: FormatSelectionRange) = | ||
let range = | ||
{ Start = | ||
{ Line = range.StartLine - 1 | ||
Character = range.StartColumn } | ||
End = | ||
{ Line = range.EndLine - 1 | ||
Character = range.EndColumn } } | ||
[| { Range = range; NewText = formatted } |] | ||
""" | ||
{ config with IndentSize = 2 } | ||
|> prepend newline | ||
|> should | ||
equal | ||
""" | ||
let handlerFormattedRangeDoc (lines: NamedText, formatted: string, range: FormatSelectionRange) = | ||
let range = { | ||
Start = { | ||
Line = range.StartLine - 1 | ||
Character = range.StartColumn | ||
} | ||
End = { | ||
Line = range.EndLine - 1 | ||
Character = range.EndColumn | ||
} | ||
} | ||
[| { Range = range; NewText = formatted } |] | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.