convert field to local: preserve comments

This commit is contained in:
Anna.Kozlova
2018-08-14 14:48:34 +02:00
parent 69e6d8afd2
commit 2a8a14a528
3 changed files with 4 additions and 2 deletions

View File

@@ -117,7 +117,7 @@ public abstract class BaseConvertToLocalQuickFix<V extends PsiVariable> implemen
variable,
refsSet,
delete,
declaration -> anchor.replace(declaration)
declaration -> new CommentTracker().replaceAndRestoreComments(anchor, declaration)
);
}

View File

@@ -2,6 +2,7 @@
class Test {
int getFoo1() {
//c1
int myFoo = 1;
return myFoo;
}

View File

@@ -3,7 +3,8 @@ class Test {
private int my<caret>Foo;
int getFoo1() {
myFoo = 1;
myFoo//c1
= 1;
return myFoo;
}