Skip to content
This repository was archived by the owner on Oct 31, 2021. It is now read-only.
This repository was 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

@TeaDrivenDev

Description

@TeaDrivenDev

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions