mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
IDEA-25753 Surround With try-catch etc. - doesn't indent comment correctly
1. Java 'surround with' processing is corrected for the first comment statement; 2. Corresponding tests are added; 3. Green cody policy is applied;
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
<selection>// This is comment"
|
||||
int i = 1;</selection>
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
{
|
||||
// This is comment"
|
||||
int i = 1;
|
||||
}<caret>
|
||||
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
<selection>// This is comment"
|
||||
int i = 1;</selection>
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
do {
|
||||
// This is comment"
|
||||
int i = 1;
|
||||
} while (<caret><selection>true</selection>);
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
<selection>// This is comment"
|
||||
int i = 1;</selection>
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
for (<caret>) {
|
||||
// This is comment"
|
||||
int i = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
<selection>// This is comment"
|
||||
int i = 1;</selection>
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
if (<caret>) {
|
||||
// This is comment"
|
||||
int i = 1;
|
||||
} else {
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
<selection>// This is comment"
|
||||
int i = 1;</selection>
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
if (<caret>) {
|
||||
// This is comment"
|
||||
int i = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
<selection>// This is comment"
|
||||
int i = 1;</selection>
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
Runnable <caret><selection>runnable</selection> = new Runnable() {
|
||||
public void run() {
|
||||
// This is comment"
|
||||
int i = 1;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
<selection>// This is comment"
|
||||
int i = 1;</selection>
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
synchronized (<caret>) {
|
||||
// This is comment"
|
||||
int i = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
<selection>// This is comment"
|
||||
int i = 1;</selection>
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
try {
|
||||
// This is comment"
|
||||
int i = 1;
|
||||
} catch (Exception e) {
|
||||
<caret><selection>e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.</selection>
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
<selection>// This is comment"
|
||||
int i = 1;</selection>
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
try {
|
||||
// This is comment"
|
||||
int i = 1;
|
||||
} catch (Exception e) {
|
||||
<caret><selection>e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.</selection>
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
<selection>// This is comment"
|
||||
int i = 1;</selection>
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
try {
|
||||
// This is comment"
|
||||
int i = 1;
|
||||
} finally {<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
<selection>// This is comment"
|
||||
int i = 1;</selection>
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
while (<caret><selection>true</selection>) {
|
||||
// This is comment"
|
||||
int i = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user