fsprojects-archive / zzarchive-VisualFSharpPowerTools

[ARCHIVED] Power commands for F# in Visual Studio
http://fsprojects.github.io/VisualFSharpPowerTools/
Apache License 2.0
310 stars 77 forks source link

Provide an easy way to add/remove type annotations for function parameters #1486

Open TeaDrivenDev opened 7 years ago

TeaDrivenDev commented 7 years ago

Description

There should be an easy way to add type annotations to function parameters or remove them, as this operation currently requires a sequence of fiddly and largely mechanical navigation and typing actions.

Expected behavior

When the caret is on a function parameter, detect whether the symbol currently has a type annotation.

If it doesn't, show a light bulb suggestion to allow adding the type annotation - parentheses, colon and a type placeholder. If the compiler can determine the type of the symbol, it should be used for the annotation. Ideally, that should also correctly determine generic type variables used elsewhere in the function signature or scope (for nested functions).

If the symbol currently has a type annotation, show a light bulb suggestion to remove the annotation. This is primarily to reduce the mechanical work; if that causes the code to not compile, that is the user's responsibility.

dungpa commented 7 years ago

We would like to implement this feature request as part of FSSF mentorship program. This seems like useful yet small enough feature to work on. Further discussion is welcome.