void (String oldName, String newName, ChainContext context) { if(oldName.equals(newName)) return; PsiExpression qualifier = myMethodRef.getQualifierExpression(); if(qualifier == null) return; qualifier = replaceVarReference(qualifier, oldName, newName, context); myMethodRef = fromText(context, qualifier.getText()+"::"+myMethodRef.getReferenceName()); }