Skip to content

LS: code action to inline all constant usages #5973

Description

@ankddev

Related to #5891 and could be fixed in the same PR. I think that we could offer code action with name like Inline all constant usages on constant definition. For example:

const x = 0
//        ^ Trigger code action here

pub fn main() {
  echo x
  wibble(x)
}

would result in this code:

pub fn main() {
  echo 0
  wibble(0)
}

Open questions

  • Should it delete constant definition?
  • Should we be able to trigger it only on definition or on usages too?

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