FsAutoComplete icon indicating copy to clipboard operation
FsAutoComplete copied to clipboard

Code-fix for _.Property / _.MethodCall() / _.IndexerAccess[idx] shorthand for accessor functions

Open edgarfgp opened this issue 8 months ago • 0 comments

Details

Now that https://github.com/dotnet/fsharp/pull/13907 is merged would be good to have code-fix for this

// From
let a5 : {| Foo : int -> {| X : string |} |} -> string = fun x -> x.Foo(5).X

// To
let a5 : {| Foo : int -> {| X : string |} |} -> string = _.Foo(5).X

// From
let a6 = [1] |> List.map(fun x -> x.ToString())

// To
let a6 = [1] |> List.map _.ToString()

Note:

  • https://github.com/fsharp/FsAutoComplete/pull/1180 needs to me merged first to work on this.
  • Branching off of nightly could also be the way to go to work on that codefix at the moment

Checklist

  • [X] I have looked through existing issues to make sure that this feature has not been requested before
  • [X] I have provided a descriptive title for this issue
  • [X] I am aware that even valid feature requests may be rejected if they do not align with the project's goals
  • [X] I or my company would be willing to contribute this feature

edgarfgp avatar Nov 06 '23 14:11 edgarfgp