resharper-fsharp icon indicating copy to clipboard operation
resharper-fsharp copied to clipboard

Code vision also for local function/let-binding

Open drhumlen opened this issue 5 years ago • 7 comments

Currently we have code vision for top level let-bindings, members and let-binding directly inside a module.

If we could extend the current behaviour to also show type information for local let-bindings that would be amazing imo.

If we just use the same presentation for local let-bindings as top-level ones, this should be a relatively low-hanging fruit now that the ground work is done?

This issue is an extension of the feature from #20 . It's easier to discuss this change in a new non-closed issue.

drhumlen avatar Sep 22 '19 21:09 drhumlen

Screenshot 2019-10-01 at 15 54 26

This is one of the reasons I want code vision btw. Often hovering a variable to see its type doesn't work because there's another thing that takes precedence – like this warning.

drhumlen avatar Oct 01 '19 13:10 drhumlen

@drhumlen Ctrl+Q shows a popup window with a symbol type (in C# format).

vasily-kirichenko avatar Oct 01 '19 16:10 vasily-kirichenko

@vasily-kirichenko : I'm on MacOS so the keybinding is different, but it's the action called "Quick documentation" (F1 for me), right? I guess that's better than nothing for an emergency, but really want my type info in F# format, not some C#ified interpretation.

Also moving my cursor from where I'm working, over to the symbol and click it & ctrl+q/f1 throws me out of my coding flow compared to just seeing the inferred type as a Code Vision. So much nicer.

drhumlen avatar Oct 02 '19 10:10 drhumlen

@drhumlen I'd like inferred type to be part of the tooltip, AFAIK it's gonna be possible as soon as Rider moves to standard IDEA tooltips.

vasily-kirichenko avatar Oct 02 '19 10:10 vasily-kirichenko

I’ve noticed that in 2019.3 there’s a type annotation/hint for every var in c#. Would be nice to have the same in F# (rendered inline the same way?)

drhumlen avatar Nov 01 '19 18:11 drhumlen

Indeed, this would be very useful!

endeavour avatar Sep 17 '20 19:09 endeavour

It can easily become a bit noisy, but if combined with the new "Hold ctrl to view inlay hints" feature, I think this makes more sense now than it did when I opened the issue.

drhumlen avatar Dec 15 '20 12:12 drhumlen