ModCommand (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getStartElement(); PsiFile origFile = element.getContainingFile(); PsiDirectory directory = origFile.getContainingDirectory(); if (directory == null) return ModCommand.nop(); return ModCommand.psiUpdate(element, (e, updater) -> applyFix(e, origFile, directory)); }