File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
src/FsAutoComplete/CodeFixes
test/FsAutoComplete.Tests.Lsp/CodeFixTests Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ let fix (getParseResultsForFile: GetParseResultsForFile) : CodeFix =
8585 Path = path
8686 NeedsParensAfterNot = true }
8787
88+ // X.Y()
89+ | SynExpr.App( funcExpr = SynExpr.LongIdent( longDotId = LastIdentFromSynLongIdent ident))
90+
8891 // X().Y()
8992 | SynExpr.App( funcExpr = SynExpr.DotGet( longDotId = LastIdentFromSynLongIdent ident))
9093
Original file line number Diff line number Diff line change @@ -180,4 +180,24 @@ type X() =
180180
181181let b = not (X().Y())"
182182
183+ testCaseAsync " negate instance member invocation"
184+ <| CodeFix.check
185+ server
186+ "
187+ open System.Collections.Generic
188+
189+ let foo () =
190+ let dict = dict []
191+ dict.TryAdd$0(\" foo\" , \" bar\" )
192+ ()"
193+ Diagnostics.acceptAll
194+ selectCodeFix
195+ "
196+ open System.Collections.Generic
197+
198+ let foo () =
199+ let dict = dict []
200+ (not (dict.TryAdd(\" foo\" , \" bar\" )))
201+ ()"
202+
183203 ])
You can’t perform that action at this time.
0 commit comments