Skip to content

support adapter for IDocument in LSPEclipseUtils #1500

@raghucssit

Description

@raghucssit

org.eclipse.lsp4e.LSPEclipseUtils.getFile(IDocument) and org.eclipse.lsp4e.LSPEclipseUtils.toUri(IDocument) uses the eclipse buffer allocated by buffer manager to IDocument to determine the java.netURI and org.eclipse.core.resources.IFile.

Some framework like Xtext does not connect their document to buffer manager. So LSPEclipseUtils returns null for URI and IFile in such cases.
So we can try to adapt the IDocument to URI and IFile. Off course implementors of IDocument shold adapt themselves for this feature to work.

I have created a PR to support adaption of XtextDocument but that is not precondition for this PR.
eclipse-xtext/xtext#3614

More background:
Github copilot uses LSPEclipseUtils to derive URI and IFile. Which is currently failing for XtextDocuments and lacking the copilot completion support for DSL editors.
microsoft/copilot-eclipse-feedback#44

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions