Skip to content

add IAdaptable support to IXtextDocument interface - #3615

Merged
szarnekow merged 1 commit into
eclipse-xtext:mainfrom
raghucssit:implement_iadaptable_xtextdocument
Feb 25, 2026
Merged

szarnekow merged 1 commit into
eclipse-xtext:mainfrom
raghucssit:implement_iadaptable_xtextdocument

Conversation

@raghucssit

Copy link
Copy Markdown
Contributor

There is a getAdapter but interface itself is not adaptable. So we make it adaptable so that clients can adapt using IAdaptable interface.

see #3613

Copilot AI review requested due to automatic review settings February 18, 2026 16:46

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.

Pull request overview

This pull request adds IAdaptable interface support to IXtextDocument to enable GitHub Copilot and other LSP4E-based tools to properly obtain document URIs from Xtext documents. The change allows IXtextDocument instances to be adapted using the standard Eclipse IAdaptable interface, and specifically adds support for adapting to java.net.URI (distinct from EMF URI).

Changes:

  • Made IXtextDocument interface extend IAdaptable with an @Override annotation on the existing getAdapter method
  • Added java.net.URI adapter support in XtextDocument.getAdapter() implementation to resolve platform resource URIs through the IFile adapter

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/model/IXtextDocument.java Extends IAdaptable interface and adds @OverRide annotation to getAdapter method
org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/model/XtextDocument.java Implements java.net.URI adapter by obtaining IFile adapter and calling getLocationURI()

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

@raghucssit

Copy link
Copy Markdown
Contributor Author

@iloveeclipse FYI

1 similar comment
@raghucssit

Copy link
Copy Markdown
Contributor Author

@iloveeclipse FYI

@iloveeclipse iloveeclipse 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.

LGTM, just small test style improvement

@iloveeclipse

Copy link
Copy Markdown
Contributor

@szarnekow : could you please check this PR? Thanks.

@raghucssit
raghucssit force-pushed the implement_iadaptable_xtextdocument branch from 2570996 to 5717e74 Compare February 24, 2026 11:35
There is a getAdapter but interface itself is not adaptable.
So we make it adaptable so that clients can adapt using IAdaptable
interface.

see eclipse-xtext#3613
@github-actions

Copy link
Copy Markdown

Test Results

  4 854 files   -  1 607    4 854 suites   - 1 607   2h 34m 10s ⏱️ - 42m 34s
 43 240 tests +     4   42 656 ✅ +     4    584 💤 ±  0  0 ❌ ±0 
127 643 runs   - 42 416  125 890 ✅  - 41 832  1 753 💤  - 584  0 ❌ ±0 

Results for commit 5717e74. ± Comparison against base commit 4a6daa0.

@szarnekow
szarnekow merged commit 2527209 into eclipse-xtext:main Feb 25, 2026
6 of 7 checks passed
@szarnekow szarnekow added this to the Release_2.43 milestone Feb 25, 2026
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.

5 participants