[Feature Request] Context Actions (aka Lightbulb) for loops and expressions

implicit / explicit braces in expressions:



int v = (1 + 2) * 3 + (2 * 4);

the braces around (2 * 4) should turn grey but the ones around (1 + 2) not.

context  action 'remove redundant braces' would remove the braces around (2 * 4)

context  action 'add implicit braces' on the above expression would  produce :

int v = (((1 + 2) * 3) + (2 * 4));

all braces except those  around (1 + 2) would be grey.

This  would be useful in situations in which one is unsure about the operator  precedence.


Loop conversions:


Context actions (Lightbulb) for converting loops:
foreach <-> for <-> while <-> do..while <-> Linq   etc.

for (int i = 0; i < 10; i++)

{

     Console.WriteLine(i);

}


// <->


int i = 0;

while(i < 10)

{

     Console.WriteLine(i++);     

}


// <->


foreach (var i in Enumerable.Range(0,10))
{
     Console.WriteLine(i);
}

...

Please sign in to leave a comment.