void (@NotNull final Collection<? extends FoldingDescriptor> descriptors, @NotNull final Editor editor, @NotNull final Project project) { List<MyFoldingDescriptorWrapper> model = orderByPosition(descriptors); JBPopupFactory.getInstance() .createPopupChooserBuilder(model) .setTitle(IdeBundle.message("goto.custom.region.command")) .setResizable(false) .setMovable(false) .setItemChosenCallback((selection) -> { PsiElement navigationElement = selection.getDescriptor().getElement().getPsi(); if (navigationElement != null) { navigateTo(editor, navigationElement); IdeDocumentHistory.getInstance(project).includeCurrentCommandAsNavigation(); } }) .createPopup() .showInBestPositionFor(editor); }