Skip to content

Add highlight feature for resources in eclipse explorers - #4414

Open
elsazac wants to merge 1 commit into
eclipse-platform:masterfrom
elsazac:HighlightImarkerImp
Open

elsazac wants to merge 1 commit into
eclipse-platform:masterfrom
elsazac:HighlightImarkerImp

Conversation

@elsazac

@elsazac elsazac commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Refs: #4336 and eclipse-jdt/eclipse.jdt.ui#3135

This PR adds a new highlight feature to the Eclipse explorers. It allows users to mark individual files with 255,0,0 text color as default foreground color along with bold font for the text, making important files easier to identify quickly. This also adds a bookmark overlay icon to the resources in order to make it easily recognizable.

In large Eclipse workspaces with many projects and files, it can be difficult to find the files you need.

For example:

  • Files with similar names — for eg, files such as IBreakpointListener.java, IBreakpointManager.java, IBreakpointManagerListener.java, and IBreakpointsListener.java can look very similar and be difficult to distinguish. Highlighting makes the file you need stand out.
  • Files currently being worked on — Highlighting helps users keep track of files that are important for the current task.
  • Important configuration files — Build scripts, deployment files, properties files, and other important configuration files can be highlighted so they are easier to notice.
E1.mov

Project Explorer :
image

Package Explorer :
image

This feature allows to Bookmark resources directly from the explorers context menu using the "Toggle Bookmark" context menu option. Bookmarked resources are visually distinguished in the explorer with a configurable foreground color defined under
Window > Preferences > General > Appearance > Colors and Fonts.

image

To enable the option right click on the resource and click on "Toggle Bookmark". To remove the bookmark, right-click the resource and select it again. The Bookmark is then removed.

image

The bookmarked entries are also available inside the bookmarks view. The resources will also have a bookmark overlay icon to make it visually recognizable.

image

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ± 0     867 suites  ±0   48m 34s ⏱️ - 5m 38s
 8 573 tests +28   8 333 ✅ +28  240 💤 ±0  0 ❌ ±0 
21 591 runs  +84  20 918 ✅ +84  673 💤 ±0  0 ❌ ±0 

Results for commit 116da67. ± Comparison against base commit ad7efa0.

♻️ This comment has been updated with latest results.

@elsazac
elsazac force-pushed the HighlightImarkerImp branch 3 times, most recently from c24bc83 to f72f72d Compare September 30, 2026 04:21
@elsazac

elsazac commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

@merks Could you check this?

@iloveeclipse

Copy link
Copy Markdown
Member

I wonder whether instead of "Highlight" and "Highlights" view we simply can use "Bookmark" wording and "Bookmarks" view. The proposed feature is "just" extending bookmarks functionality from editors to any resource in the explorers.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Highlighting is invisible by default, and the new view and theme-refresh behavior contain functional issues.

Review effort: Balanced
Findings: 4 Medium severity · 5 Low severity

Open (9)
What changed in this PR

Adds persistent resource highlighting across Eclipse explorers, backed by workspace markers and exposed through a dedicated Highlights view.

Changes:

  • Adds highlight marker management, context-menu toggling, and label decoration.
  • Adds configurable highlight coloring.
  • Adds a marker-based view listing highlighted resources.
File Description
ResourceHighlightManager.java Manages persistent highlight markers.
ResourceHighlightDecorator.java Applies highlight styling and refreshes labels.
ToggleHighlightHandler.java Toggles highlights for selected resources.
org.eclipse.ui.navigator.resources/​plugin.xml Registers commands, menu, decorator, color, and marker.
org.eclipse.ui.navigator.resources/​plugin.properties Adds localized extension labels.
MarkerSupportRegistry.java Defines the Highlights generator ID.
MarkerTypeField.java Special-cases highlight marker display.
HighlightResourceTypeField.java Displays highlighted resource types.
HighlightedResourcesView.java Implements the Highlights view.
org.eclipse.ui.ide/​plugin.xml Registers the view and marker columns.
org.eclipse.ui.ide/​plugin.properties Adds view and field labels.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread bundles/org.eclipse.ui.ide/plugin.xml Resolved
@elsazac

elsazac commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

I wonder whether instead of "Highlight" and "Highlights" view we simply can use "Bookmark" wording and "Bookmarks" view. The proposed feature is "just" extending bookmarks functionality from editors to any resource in the explorers.

@iloveeclipse
Thank you for the review. That could definitely be done. But I was just wondering if, since we already have a Bookmarks view in Eclipse , giving the same name might cause some confusion between the two views for users?.

@iloveeclipse

Copy link
Copy Markdown
Member

I was just wondering if, since we already have a Bookmarks view in Eclipse , giving the same name might cause some confusion between the two views for users?.

Not same name, same view. Just use same view to manage bookmarks, independently whether they are created for a text editor or for a resource in explorer.

@merks

merks commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

It seems an appealing suggestion. Less is more...

@elsazac

elsazac commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

Not same name, same view. Just use same view to manage bookmarks, independently whether they are created for a text editor or for a resource in explorer.

Yes, that's possible. I will update the PR accordingly.

@iloveeclipse

Copy link
Copy Markdown
Member

Also I wonder if the "highlight" which is currently shown only as color could be changed and additionally provide a "bookmark" overlay in the top right corner of the element in the explorers. In your video where just color is used, it is barely different from the rest. Also consider color blind people here which might not notice color if set anyway.

@elsazac

elsazac commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

Also I wonder if the "highlight" which is currently shown only as color could be changed and additionally provide a "bookmark" overlay in the top right corner of the element in the explorers. In your video where just color is used, it is barely different from the rest. Also consider color blind people here which might not notice color if set anyway.

Just to make sure I understand correctly, by “top right corner of the element,” do you mean the top-right of the file/folder icon in explorers? something like below?
image

@iloveeclipse

Copy link
Copy Markdown
Member

Yes

@merks

merks commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

@BeckerWdf

Maybe design experts have advice to share?

@elsazac
elsazac force-pushed the HighlightImarkerImp branch from 79ce847 to 05692fe Compare October 5, 2026 06:38
@elsazac

elsazac commented Oct 5, 2026 •

Copy link
Copy Markdown
Member Author

I have removed the dedicated view that was created earlier and integrated this into the Bookmarks view in Eclipse. I also added an overlay icon to the resources so they can be easily identified in the explorers.

By Default :
image

If a specific foreground color applied :
image

So now one can highlight resources directly from the context menu also they can select a foreground color of their choice. The selected resource will be highlighted with that color and will display an overlay bookmarks icon, along with a corresponding entry in the Bookmarks view.

image

@elsazac
elsazac force-pushed the HighlightImarkerImp branch from 05692fe to ef254e1 Compare October 8, 2026 05:27
@MohananRahul MohananRahul added the noteworthy Noteworthy feature label Oct 8, 2026
@elsazac

elsazac commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

@iloveeclipse any more suggestions or changes on this?

@iloveeclipse

Copy link
Copy Markdown
Member

I just checked the behavior, not the code. Few points:

  1. I believe the new menu is too far down in the menu. What about to move it below "Show In"?
image
  1. The "Bookmark" menu is also used to remove bookmark. Should it be named "Toggle Bookmark" instead?
  2. The color coding is removed completely?

Beside this, it seem to work as expected, at least for me.
Not sure about others.
@BeckerWdf, @HeikoKlare WDYT about the UX here?

@iloveeclipse

Copy link
Copy Markdown
Member

Yet another point: now I see that only bookmarks created by the new method are shown in the explorer. But bookmarks added from the editor aren't shown in the explorer. I assume they should be shown now?
This would be more consistent.

image

@SougandhS

SougandhS commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

@iloveeclipse @elsazac
Nice feature! Could we use a more distinguishable default foreground colour for highlighted resources (e.g. red or a similarly strong colours like in jdt objects, breakpoints label.. That way a highlighted item stands out right away

image

@elsazac

elsazac commented Oct 8, 2026

Copy link
Copy Markdown
Member Author
  1. I believe the new menu is too far down in the menu. What about to move it below "Show In"?

Sure. I will bring the content menu to the top, below "Show In".

  1. The "Bookmark" menu is also used to remove bookmark. Should it be named "Toggle Bookmark" instead?

I will rename it.

Yet another point: now I see that only bookmarks created by the new method are shown in the explorer. But bookmarks added from the editor aren't shown in the explorer. I assume they should be shown now? This would be more consistent.

The original code for bookmarks added from the editor did not include the overlay icon, and I haven’t made any changes to that existing functionality. However, I agree that displaying the icon consistently across all bookmark entries, regardless of how they were added, makes it more consistent. I will make those changes as well.

@elsazac

elsazac commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Could we use a more distinguishable default foreground colour for highlighted resources (e.g. red or a similarly strong colours like in jdt objects, breakpoints label.. That way a highlighted item stands out right away

Yes, I think using a more prominent color, like the one in Variables view, would make it much more recognizable and easier to distinguish.

@elsazac
elsazac force-pushed the HighlightImarkerImp branch from ef254e1 to 2c6f26b Compare October 9, 2026 14:39
@elsazac

elsazac commented Oct 9, 2026 •

Copy link
Copy Markdown
Member Author

I have updated the code with below changes :

  1. Renamed the name of the feature in context ment
  2. Added the same overlay icon to normal std bookmarks as well.
  3. Gave default foreground color as 255,0,0.
  4. Placed the option at the top of the context menu
image image

@elsazac
elsazac force-pushed the HighlightImarkerImp branch from 70bd339 to dc54aac Compare November 9, 2026 05:57
@elsazac
elsazac force-pushed the HighlightImarkerImp branch 2 times, most recently from 9460cc6 to a5a1280 Compare November 9, 2026 08:04
@SougandhS
SougandhS requested a balanced review from Copilot November 10, 2026 04:29
@elsazac
elsazac force-pushed the HighlightImarkerImp branch from a5a1280 to ee590cf Compare November 10, 2026 04:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review identifies no active issues in the resource-bookmarking changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@SougandhS

Copy link
Copy Markdown
Contributor

Hi @iloveeclipse
I have tested this and is working perfectly. would it be possible to include this in M3 ?

@merks

merks commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@iloveeclipse

There's almost no runway left. What do you think? I've not had time to test yet...

@iloveeclipse

Copy link
Copy Markdown
Member

I had no time to test it yet.

@iloveeclipse

Copy link
Copy Markdown
Member

ResourceBookmarkDecoratorTest seem to be a new test, but it is not added to the testsuite?

@iloveeclipse

Copy link
Copy Markdown
Member

new command, ToggleBookmarkHandler and operation are not tested at all.

@elsazac

elsazac commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

ResourceBookmarkDecoratorTest seem to be a new test,

This test was added as suggested by the copilot here #4414 (comment)

but it is not added to the testsuite?

Does that mean it should be added here as well? tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTestSuite.java

@iloveeclipse

Copy link
Copy Markdown
Member

@elsazac : please add tests, make sure new test class is added to testsuite. If that would be available & working tomorrow, we should be ready to merge for M3. Otherwise I have bad feeling to submit new feature with zero test coverage, even if it "works for me".

@iloveeclipse

Copy link
Copy Markdown
Member

Does that mean it should be added here as well? tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTestSuite.java

Most likely yes, I don't have IDE right now.

@elsazac
elsazac force-pushed the HighlightImarkerImp branch 2 times, most recently from dd51272 to 2d74cba Compare November 11, 2026 20:35
@iloveeclipse

Copy link
Copy Markdown
Member

SetMarkerOperationTest.java is added two times?

This commit introduces a feature to bookmark a resource by applying a
configurable theme foreground color to resources in the explorer and
highlight them.These highlighted resources also has entries in the
Eclipse Marker's view with Resource, Path, Location, and Type columns.
@elsazac
elsazac force-pushed the HighlightImarkerImp branch from 2d74cba to 116da67 Compare November 11, 2026 21:15
@elsazac

elsazac commented Nov 11, 2026 •

Copy link
Copy Markdown
Member Author

SetMarkerOperationTest.java is added two times?

Sorry that, one of those got added by mistake; removed it now.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The resource-bookmarking change has no active review issues.

No open issues 🎉

Review effort: Balanced

@iloveeclipse

Copy link
Copy Markdown
Member

I still can only see font changed on packages / folders but not on single files, see #4414 (comment).

image

It seems that the decorator order or priority matters. I see that same file changed in git is not having the font applied, but only the overlay icon. I can't see here why some files are highlighted and some not. In my example it seems to be broken for files changed in git and to for files not added & ignored in git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

noteworthy Noteworthy feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants