JetBrains / resharper-fsharp

F# support in JetBrains Rider
Apache License 2.0
327 stars 56 forks source link

Code vision also for local function/let-binding #62

Open drhumlen opened 5 years ago

drhumlen commented 5 years ago

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 commented 5 years ago

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.

vasily-kirichenko commented 5 years ago

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

drhumlen commented 5 years ago

@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.

vasily-kirichenko commented 5 years ago

@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.

drhumlen commented 5 years ago

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?)

endeavour commented 4 years ago

Indeed, this would be very useful!

drhumlen commented 3 years ago

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.