void (final @NotNull Project project, final @NotNull ProblemDescriptor descriptor) { final PsiFile containingFile = descriptor.getPsiElement().getContainingFile(); Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor(); final PsiFile file = editor != null ? PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()) : null; if (file == null || !Comparing.equal(file.getVirtualFile(), containingFile.getVirtualFile())) return; try { invoke(project, editor, containingFile); } catch (IncorrectOperationException ex) { LOG.error(ex); } }