void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiDirectory[] dirs = getDirectories(); final List<VirtualFile> roots = getPotentialRoots(myModule, dirs); if (roots.size() == 1) { ApplicationManager.getApplication().runWriteAction(() -> createDescription(roots.get(0))); } else { final Editor editor = FileEditorManager.getInstance(myModule.getProject()).getSelectedTextEditor(); if (editor == null) return; JBPopupFactory.getInstance() .createPopupChooserBuilder(roots) .setRenderer(SimpleListCellRenderer.create("", VirtualFile::getPath)) .setSelectionMode(ListSelectionModel.SINGLE_SELECTION) .setTitle(DevKitBundle.message("select.target.location.of.description", myFilename)) .setItemChosenCallback((root) -> ApplicationManager.getApplication().runWriteAction(() -> createDescription(root))) .createPopup() .showInBestPositionFor(editor); } }