ModCommand (@NotNull ActionContext context) { PsiInstanceOfExpression instanceOfExpression = getInstanceOfExpressionAtCaret(context.file(), context.offset()); if (instanceOfExpression == null) return ModCommand.nop(); return ModCommand.psiUpdate(instanceOfExpression, (expr, updater) -> invoke(context, expr, updater)); }