eclipse-xtext / eclipse-xtext/xtext

Support multiple comparators (for sorting) in outline view.

Open
#2,375 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help_wanted
Dominant language
Java
Stars
831
Forks
330
Avg merge
3d 7h
Merged PRs (30d)
12

Description

At the moment, the outline view only supports a single comparator. The default sort contribution is defined in org.eclipse.xtext.ui.editor.outline.actions.SortOutlineContribution.

Simply registering multiple sort contributions does not work since the underlying API does not support multiple comparators, cf. org.eclipse.xtext.ui.editor.outline.impl.OutlineFilterAndSorter (multiple filters via add, only one comparator via set).

If would be great if multiple comparators were supported, e.g., by extending the comparator interface org.eclipse.xtext.ui.editor.outline.impl.OutlineFilterAndSorter.IComparator with a org.eclipse.xtext.ui.editor.actions.AbstractToggleActionContributor.configureAction(Action) like method. Then, instead of providing different "sort contributions", one can configure (in the UIModule) multiple comparators.

Of course in that case the "multiple comparator aware" sort contributions would have to toggle between the comparators.

Cf. forum: https://www.eclipse.org/forums/index.php/mv/msg/1088234/1770617/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read org.eclipse.xtext.ui.editor.outline.impl.OutlineFilterAndSorter and the IComparator interface, then inspect org.eclipse.xtext.ui.editor.outline.actions.SortOutlineContribution and the related UIModule configuration. Define how multiple comparators are configured and selected, including how sort contributions toggle them; done means the outline view supports multiple registered comparators without breaking existing sorting.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.