Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

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

Open
TeaDrivenDev opened this issue Nov 21, 2016 · 1 comment

Comments

@TeaDrivenDev
Copy link
Contributor

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
Copy link
Contributor

dungpa commented Nov 21, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants