mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
refix rename method refs
This commit is contained in:
+6
-1
@@ -115,8 +115,10 @@ public class PsiMethodReferenceExpressionImpl extends PsiReferenceExpressionBase
|
||||
final IElementType elType = child.getElementType();
|
||||
if (elType == JavaTokenType.DOUBLE_COLON) {
|
||||
return ChildRole.DOUBLE_COLON;
|
||||
} else if (elType == JavaTokenType.IDENTIFIER || elType == JavaElementType.REFERENCE_EXPRESSION) {
|
||||
} else if (elType == JavaTokenType.IDENTIFIER) {
|
||||
return ChildRole.REFERENCE_NAME;
|
||||
} else if (elType == JavaElementType.REFERENCE_EXPRESSION) {
|
||||
return ChildRole.CLASS_REFERENCE;
|
||||
}
|
||||
return ChildRole.EXPRESSION;
|
||||
}
|
||||
@@ -205,6 +207,9 @@ public class PsiMethodReferenceExpressionImpl extends PsiReferenceExpressionBase
|
||||
@Override
|
||||
public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
|
||||
PsiElement oldIdentifier = findChildByRoleAsPsiElement(ChildRole.REFERENCE_NAME);
|
||||
if (oldIdentifier == null) {
|
||||
oldIdentifier = findChildByRoleAsPsiElement(ChildRole.CLASS_REFERENCE);
|
||||
}
|
||||
if (oldIdentifier == null) {
|
||||
throw new IncorrectOperationException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user