diff --git a/test/FsAutoComplete.Tests.Lsp/CodeFixTests/Tests.fs b/test/FsAutoComplete.Tests.Lsp/CodeFixTests/Tests.fs index fee7850ec..07357f3ec 100644 --- a/test/FsAutoComplete.Tests.Lsp/CodeFixTests/Tests.fs +++ b/test/FsAutoComplete.Tests.Lsp/CodeFixTests/Tests.fs @@ -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 =