public class Foo
{
public void foo()
{
//some comment about x
int x = 1;
//some comment about y
int y=1;
}
}
After highlighting the two comments and two variable declarations:
//some comment about x
int x = 1;
//some comment about y
int y=1;
and performing a "surround with" operation (Ctrl+Alt+T) the resultant code looks like this:
public class Foo
{
public void foo()
{
if (<caret>)
{
//some comment about x
int x = 1;
//some comment about y
int y=1;
}
}
}
The x comment should be indented to match the code it is commenting, not be flush with the margin. That should only happen if the original comment was a commented out line (via a ctrl+Slash). This only seems to be an issue with a comment if it is the first line in the highlighted block.
And since the comment is flush with the left margin, a code reformat does not fix it since the code reformatter treats it as if it was a commented out line of code, leaving it flush with the left margin.
Description
Code prior to using Surround With:
public class Foo
{
public void foo()
{
//some comment about x
int x = 1;
//some comment about y
int y=1;
}
}
After highlighting the two comments and two variable declarations:
//some comment about x
int x = 1;
//some comment about y
int y=1;
and performing a "surround with" operation (Ctrl+Alt+T) the resultant code looks like this:
public class Foo
{
public void foo()
{
if (<caret>)
{
//some comment about x
int x = 1;
//some comment about y
int y=1;
}
}
}
The x comment should be indented to match the code it is commenting, not be flush with the margin. That should only happen if the original comment was a commented out line (via a ctrl+Slash). This only seems to be an issue with a comment if it is the first line in the highlighted block.
And since the comment is flush with the left margin, a code reformat does not fix it since the code reformatter treats it as if it was a commented out line of code, leaving it flush with the left margin.