mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
inplace rename: include the whole file in rename scope. when the substitutor is located in the same file it would be included in rename process (IDEA-86294)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
class Demo {
|
||||
class MyEvent<T> {}
|
||||
interface MyEventListener<T> {
|
||||
void action(MyEvent<T> event);
|
||||
}
|
||||
|
||||
class Driver {
|
||||
void method() {
|
||||
MyEventListener<Object> l = new MyEventListener<Object>() {
|
||||
public void ac<caret>tion(MyEvent<Object> event) {
|
||||
//To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
class Demo {
|
||||
class MyEvent<T> {}
|
||||
interface MyEventListener<T> {
|
||||
void xxx(MyEvent<T> event);
|
||||
}
|
||||
|
||||
class Driver {
|
||||
void method() {
|
||||
MyEventListener<Object> l = new MyEventListener<Object>() {
|
||||
public void xxx(MyEvent<Object> event) {
|
||||
//To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,10 @@ public class RenameMembersInplaceTest extends LightCodeInsightTestCase {
|
||||
public void testSuperMethod() throws Exception {
|
||||
doTestInplaceRename("xxx");
|
||||
}
|
||||
|
||||
public void testSuperMethodAnonymousInheritor() throws Exception {
|
||||
doTestInplaceRename("xxx");
|
||||
}
|
||||
|
||||
public void testMultipleConstructors() throws Exception {
|
||||
doTestInplaceRename("Bar");
|
||||
|
||||
+4
-7
@@ -84,14 +84,11 @@ public class MemberInplaceRenamer extends VariableInplaceRenamer {
|
||||
|
||||
@Override
|
||||
protected PsiElement checkLocalScope() {
|
||||
PsiElement scope = super.checkLocalScope();
|
||||
if (scope == null) {
|
||||
PsiFile currentFile = PsiDocumentManager.getInstance(myProject).getPsiFile(myEditor.getDocument());
|
||||
if (currentFile != null) {
|
||||
return currentFile;
|
||||
}
|
||||
PsiFile currentFile = PsiDocumentManager.getInstance(myProject).getPsiFile(myEditor.getDocument());
|
||||
if (currentFile != null) {
|
||||
return currentFile;
|
||||
}
|
||||
return scope;
|
||||
return super.checkLocalScope();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user