ModCommand (@NotNull ActionContext context) { return ModCommand.psiUpdate(myOutOfScopeVariable, (outOfScopeVariable, updater) -> { PsiReferenceExpression reference = updater.getWritable(myUnresolvedReference); invoke(outOfScopeVariable, reference); }); }