mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
inplace rename: include nameIdentifier in rename template when no reference covers this identifier
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class Test {
|
||||
void foo(boolean b) {
|
||||
System.out.println(<caret>b);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class Test {
|
||||
void foo(boolean a) {
|
||||
System.out.println(a);
|
||||
}
|
||||
}
|
||||
@@ -88,6 +88,10 @@ public class RenameLocalTest extends LightRefactoringTestCase {
|
||||
doTestInplaceRename("a");
|
||||
}
|
||||
|
||||
public void testRenameInPlaceOnRef() throws Exception {
|
||||
doTestInplaceRename("a");
|
||||
}
|
||||
|
||||
public void testRenameInPlaceParamInOverriderAutomaticRenamer() throws Exception {
|
||||
doTestInplaceRename("pp");
|
||||
}
|
||||
@@ -119,7 +123,7 @@ public class RenameLocalTest extends LightRefactoringTestCase {
|
||||
private void doTestInplaceRename(final String newName) throws Exception {
|
||||
configureByFile(BASE_PATH + "/" + getTestName(false) + ".java");
|
||||
|
||||
final PsiElement element = TargetElementUtilBase.findTargetElement(myEditor, TargetElementUtilBase.ELEMENT_NAME_ACCEPTED);
|
||||
final PsiElement element = TargetElementUtilBase.findTargetElement(myEditor, TargetElementUtilBase.ELEMENT_NAME_ACCEPTED | TargetElementUtilBase.REFERENCED_ELEMENT_ACCEPTED);
|
||||
assertNotNull(element);
|
||||
assertTrue("In-place rename not allowed for " + element,
|
||||
JavaRefactoringSupportProvider.mayRenameInplace(element, null));
|
||||
|
||||
Reference in New Issue
Block a user