Skip to content

Code action to remove redundant list prepend #5918

Description

@GearsDatapacks

I often run into a situation where I have some code like this, where I'm mapping a list and adding one or more other items to it:

[wibble, ..list.map(some_list, todo)]

Then, for some reason I decide to remove the prepended wibble:

[..list.map(some_list, todo)]

This leave me with a compiler error, as prepending nothing to lists is not allowed. If the list spans multiple lines, it can be a little tedious to clean this up as you need to delete the opening bracket, the .. and the closing bracket, all of which are on separate lines.

So it would be nice to have a code action which rewrites [..x] to just x.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions