Skip to content

Enhancement Proposal: Unified Diff Visualization for Eclipse Text Editor #3771

@BeckerWdf

Description

@BeckerWdf

Overview

SAP's ABAP Development tools team propose to introduce a new inline unified diff visualization mode for Eclipse's text compare functionality.
This provides an alternative to the traditional side-by-side 2-way comparison view. The unified diff is presented directly within a single text editor using visual annotations and code minings, offering a more compact and contextual way to review changes between file revisions.
Especially in AI-based use cases this is very helpful and the de-facto standard in other IDEs out in the market. Eclipse should also offer this feature in it's editors as well as an API for downstream consumers to use this for their use cases in their products.

This looks like the following:
Image

@tobiasmelcher already showed a first proof of concept in the "Eclipse IDE - Developers community call on 15th of January 2026.

Key Features

Inline Diff Rendering

  • Displays additions and deletions directly within the document using color-coded annotations (theme dependent)
  • Two-level annotation system: line-level changes and detailed character-level differences within lines

Code Mining Integration

  • Leverages Eclipse's code mining framework (org.eclipse.ui.workbench.texteditor.codeMiningProviders)
  • Provides line header decorations showing addition/deletion indicators
  • Syntax coloring support for the text rendered in the code minings
  • Non-intrusive visualization that doesn't disrupt document structure

User Configuration

  • New preference option: "Use Unified Diff instead of 2-way compare when possible" in compare preference page
  • Defaults to disabled (off) to maintain backward compatibility
Image

Initial Integration

  • Currently activated when comparing two file revision history entries in read-only mode
  • Preference “Use unified Diff” must be set to true (CompareUIPlugin#openCompareEditor internally checks the preference and is then opening the unified diff instead of the 2-way compare)

Open Topics

  • UX of the Accept / Cancel / Keep / Undo / ... buttons
  • How to ensure accessibility (keyboard navigation / integration into screen readers)

Way Forward

These are the different steps in which we would like to develop / contribute this.

  1. Provide existing PoC implementation as draft PR for review (Introduce Unified Diff display mode to Compare editor eclipse.platform#2560)
  2. Code cleanup of existing PoC implementation
  3. Prepare existing platform APIs to that the new feature can use them (without reflection etc.)
  4. Provide a first Implementation of the feature (API still marked as internal)
  5. Provide a "internal switch" to turn the feature on for testing but have it invisible in the shipped release
  6. Ship the feature turned off
  7. Maybe: Ship the feature turned on
  8. Make the API for this official API

We will create follow up issues / pull request and link them here.

Your review, feedback as well as you coding-help is much appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions