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.
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:
Then, for some reason I decide to remove the prepended
wibble: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 justx.