Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions test/FsAutoComplete.Tests.Lsp/CodeFixTests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3651,6 +3651,24 @@ let private removeUnnecessaryParenthesesTests state =
(Diagnostics.expectCode "FSAC0004")
selector

// Regression test for https://github.com/ionide/FsAutoComplete/issues/1362
// Parens around a float literal in a chained method call are necessary:
// bg.lighten(0.2).hexa ()
// Removing them would produce invalid code:
// bg.lighten 0.2.hexa ()
testCaseAsync "Keep parens around float literal argument in chained method call (issue #1362)"
<| CodeFix.checkNotApplicable
server
"""
type C(v: float) =
member _.lighten(x: float) = C(v + x)
member _.hexa() = v.ToString()
let bg = C(0.5)
bg.lighten((0.2)$0).hexa ()
"""
Diagnostics.acceptAll
selector

])

let tests textFactory state =
Expand Down
Loading