void (@NotNull PsiFile file) { Project project = file.getProject(); VirtualFile vFile = file.getVirtualFile(); doAddAnnotation(project); UndoManager.getInstance(project).undoableActionPerformed(new BasicUndoableAction(vFile) { @Override public void undo() { if (myWriteAnnotations.removeAll(List.of(myQualifiedName))) { ProjectInspectionProfileManager.getInstance(project).fireProfileChanged(); } } @Override public void redo() { doAddAnnotation(project); } }); }