Skip to content

Add semantic highlighting to the Java compare/merge viewer #2929#2930

Merged
iloveeclipse merged 1 commit intoeclipse-jdt:masterfrom
Philipp0205:issue_2929
Apr 30, 2026
Merged

Add semantic highlighting to the Java compare/merge viewer #2929#2930
iloveeclipse merged 1 commit intoeclipse-jdt:masterfrom
Philipp0205:issue_2929

Conversation

@Philipp0205
Copy link
Copy Markdown
Contributor

@Philipp0205 Philipp0205 commented Apr 6, 2026

This change installs semantic highlighting in CompilationUnitEditorAdapter.doSetInput() when the user preference is enabled to have the same syntax higlighting in the compare viewer than in the regular java editor.

Fixes #2929

Compare view before:
compareViewBefore

Compare view after:
compareViewAfter

@iloveeclipse
Copy link
Copy Markdown
Member

Build is failing because of Eclips.org infrastructure issues.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds semantic highlighting support to the Java compare/merge viewer so it can render Java code with the same richer coloring as the regular Java editor (when enabled via preferences), addressing #2929.

Changes:

  • Import semantic-highlighting support (SemanticHighlightings) into the compare viewer’s editor adapter.
  • Install semantic highlighting in CompilationUnitEditorAdapter.doSetInput() when semantic highlighting is enabled and a Java element is available.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaMergeViewer.java Outdated
@Philipp0205
Copy link
Copy Markdown
Contributor Author

Build is failing because of Eclips.org infrastructure issues.

Good. I was already wondering 😄

@Philipp0205
Copy link
Copy Markdown
Contributor Author

@iloveeclipse updated the PR. I would propose to integrate this which works for the Egit Revison side and create another PR for the Local History side.

@iloveeclipse
Copy link
Copy Markdown
Member

08:53:24  [ERROR] /home/jenkins/agent/workspace/eclipse.jdt.ui-github_PR-2930/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaMergeViewer.java:[88] 
08:53:24  [ERROR] 	import org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightings;
08:53:24  [ERROR] 	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
08:53:24  [ERROR] The import org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightings is never used

@Philipp0205
Copy link
Copy Markdown
Contributor Author

08:53:24  [ERROR] /home/jenkins/agent/workspace/eclipse.jdt.ui-github_PR-2930/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaMergeViewer.java:[88] 
08:53:24  [ERROR] 	import org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightings;
08:53:24  [ERROR] 	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
08:53:24  [ERROR] The import org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightings is never used

mea culpa, I should not just accept github suggestions 😄

@iloveeclipse
Copy link
Copy Markdown
Member

iloveeclipse commented Apr 30, 2026

You seem now use different email in the commits, so ECA is failing.

Please

  1. Squash all commits to one
  2. Use right email
  3. Fetch from master
  4. Rebase the commit on latest master
  5. Force push on same branch

@Philipp0205 Philipp0205 force-pushed the issue_2929 branch 2 times, most recently from 3ff833d to 1d352bd Compare April 30, 2026 08:41
@iloveeclipse
Copy link
Copy Markdown
Member

@Philipp0205 : you should set commit author to the mail you've set in your Eclipse.org account. ECA check works by matching mail set there to the commit author mail.

@iloveeclipse
Copy link
Copy Markdown
Member

image image

@Philipp0205
Copy link
Copy Markdown
Contributor Author

You answer faster than I can correct my mistakes 😉

@iloveeclipse iloveeclipse merged commit f9457be into eclipse-jdt:master Apr 30, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add semantic highlighting to the Java compare / merge viewer

3 participants