@NotNull
  private ListCellRenderer<ScopeDescriptor> createRenderer() {
    return new GroupedComboBoxRenderer<>(this) {
      @NotNull
      @Override
      public @NlsContexts.ListItem String getText(ScopeDescriptor item) {
        String text = item.getDisplayName();
        return text == null ? super.getText(item) : text;
      }

      @Nullable
      @Override
      public Icon getIcon(ScopeDescriptor item) {
        return item.getIcon();
      }

      @Nullable
      @Override
      public ListSeparator separatorFor(ScopeDescriptor value) {
        if (scopes != null) return scopes.getSeparatorFor(value);
        return null;
      }

      @Override
      public void customize(@NotNull SimpleColoredComponent item,
                            ScopeDescriptor value,
                            int index,
                            boolean isSelected,
                            boolean cellHasFocus) {
        if (value == null) return;
        super.customize(item, value, index, isSelected, cellHasFocus);
      }
    };
  }
@NotNull
  private ListCellRenderer<ScopeDescriptor> createRenderer()