Skip to content

LSP: add argument(s) to function #5436

@nnuuvv

Description

@nnuuvv

I'm used to having a code action to add a new argument to a function based on usage.

i.e.:

fn wibble() {
            v - triggering "add argument to function" here
  wobble("wobble")
}

fn wobble() {
  todo
}

would change the code to this:

fn wibble() {
  wobble("wobble")
}

fn wobble(wobble: String) {
  todo
}

This, in my experience, is especially helpful when scaffolding mostly empty functions early in a new project.
As it allows quickly adding new arguments to a function call.

So instead of having to

  • goto definition
  • manually add function argument
  • go back

I can just add argument to function and keep doing what i was doing and deal with it later.

Ideally this would work with multiple arguments at a time as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions