mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
introduce variable: don't duplicate comments (IDEA-195399)
This commit is contained in:
@@ -921,10 +921,6 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase {
|
||||
declaration = addDeclaration(declaration, initializer);
|
||||
LOG.assertTrue(expr1.isValid());
|
||||
if (deleteSelf) {
|
||||
final PsiElement lastChild = statement.getLastChild();
|
||||
if (lastChild instanceof PsiComment) { // keep trailing comment
|
||||
declaration.addBefore(lastChild, null);
|
||||
}
|
||||
CommentTracker commentTracker = new CommentTracker();
|
||||
commentTracker.markUnchanged(initializer);
|
||||
commentTracker.deleteAndRestoreComments(statement);
|
||||
|
||||
@@ -10,5 +10,6 @@ class Main {
|
||||
.toArray()//c-1
|
||||
.toString();//c1
|
||||
//c2
|
||||
//c3
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,6 @@ class Main {
|
||||
.toString()</selection>
|
||||
//c1
|
||||
//c2
|
||||
;
|
||||
;//c3
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user