ionide / ionide-vscode-fsharp

VS Code plugin for F# development
http://ionide.io
MIT License
850 stars 276 forks source link

parameter suggestion in .NET class constructors escapes within lambdas #1954

Open jkone27 opened 8 months ago

jkone27 commented 8 months ago

Describe the bug

parameter name suggestion in .NET class constructors escapes one level up within lamdas

image VS image

Steps to reproduce

above steps to reproduce

Link to sample reproduction

Expected behaviour

the parameter name is displayed next to the right function, in this case Thread.Sleep constructor

Screenshots

Machine info

Additional context

this feature was recently introduced, so it's a corner case. but would love to help solve it :)

baronfel commented 8 months ago

Thanks for the report! I'd start investigating this by adding a test to the existing method-based tests, and then debug into the implementation of the feature to see where the bad range is being created/detected. All of this will be entirely in FsAutoComplete, not Ionide, and so should be easy to test in a local Ionide instance as well - if you build FSAC you can use the FSharp.fsac.netcoreDllPath setting to point to the just-built fsautocomplete.dll and reload Ionide - then it'll use the version you just built.