Skip to content

Console: publish the page's text viewer as an adapter - #3029

Merged
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:console-adapt-to-text-viewer
Oct 21, 2026
Merged

HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:console-adapt-to-text-viewer

Conversation

@HeikoKlare

@HeikoKlare HeikoKlare commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

The console page exposes its find/replace target and its text widget, but not the viewer that both of them come from. Clients that need to know where the console renders its text therefore have to ask for the widget, which describes how the text is presented rather than what presents it, and which leaves the viewer's document and selection handling out of reach.

Answering ITextViewer closes that gap, and costs nothing: the console's viewer is a SourceViewer and therefore already an ITextViewer, so the page merely publishes what it has. The existing Widget adapter stays in place for clients relying on it.

Find/Replace overlay in the Console view

The Find/Replace overlay places itself on the text viewer of the part it is opened in, and

offers it in every part that exposes such a viewer. Neither change reaches the Console view on its own: this one adds an adapter that nothing asks for yet, and the other one finds no console to offer the overlay to. Together they bring the overlay to the Console view, where Ctrl+F then opens it instead of the Find/Replace dialog, with the same behavior it has in a text editor.

image

🤖 Generated with Claude Code

The console page exposes its find/replace target and its text widget, but
not the viewer that both of them come from. Clients that need to know
where the console renders its text therefore have to ask for the widget,
which describes how the text is presented rather than what presents it,
and which leaves the viewer's document and selection handling out of
reach.

Answering ITextViewer closes that gap, and costs nothing: the console's
viewer is a SourceViewer and therefore already an ITextViewer, so the
page merely publishes what it has. The Find/Replace overlay, which places
itself on the text viewer of the part it is opened in, can thereby be
used in the console the same way as in a text editor. The existing Widget
adapter stays in place for clients relying on it.

Assisted-by: Claude Opus 5 <noreply@anthropic.com>

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 narrow adapter addition exposes a compatible existing viewer without changing existing adapter behavior.

0 open findings

What changed in this PR

Exposes the console page’s existing text viewer to clients, enabling Console Find/Replace overlay integration alongside the companion UI change.

Changes:

  • Adds an ITextViewer adapter returning the existing viewer.
  • Preserves the existing find/replace target and widget adapters.
File Description
debug/​org.eclipse.ui.console/​src/​org/​eclipse/​ui/​console/​TextConsolePage.java Imports ITextViewer and handles adapter requests for it.

🧠 Review effort: Balanced


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

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   40m 38s ⏱️ -10s
 4 863 tests ±0   4 841 ✅ ±0   22 💤 ±0  0 ❌ ±0 
12 480 runs  ±0  12 326 ✅ ±0  154 💤 ±0  0 ❌ ±0 

Results for commit 7fbf5af. ± Comparison against base commit 0abc02b.

@HeikoKlare
HeikoKlare marked this pull request as ready for review October 19, 2026 10:08

@r-mennig r-mennig left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice, simple change which publishes the internal ITextViewer as an adapter of the TextConsolePage (the same is done in e.g. org.eclipse.debug.internal.ui.views.variables.details.DefaultDetailPane).

Looks good to me.

@HeikoKlare
HeikoKlare merged commit a2c6fe9 into eclipse-platform:master Oct 21, 2026
18 checks passed
@HeikoKlare
HeikoKlare deleted the console-adapt-to-text-viewer branch October 21, 2026 06:30
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.

3 participants