Repository navigation
add IAdaptable support to IXtextDocument interface - #3615
Conversation
There was a problem hiding this comment.
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
IXtextDocumentinterface extendIAdaptablewith an@Overrideannotation on the existinggetAdaptermethod - Added
java.net.URIadapter support inXtextDocument.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.
|
@iloveeclipse FYI |
1 similar comment
|
@iloveeclipse FYI |
2c4dbfe to
2570996
Compare
iloveeclipse
left a comment
There was a problem hiding this comment.
LGTM, just small test style improvement
|
@szarnekow : could you please check this PR? Thanks. |
2570996 to
5717e74
Compare
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
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