eclipse-lsp4e / eclipse-lsp4e/lsp4e

support adapter for IDocument in LSPEclipseUtils

Open
#1,500 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
85
Forks
69
Avg merge
8h 33m
Merged PRs (30d)
6

Description

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.
https://github.com/eclipse-xtext/xtext/pull/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.
https://github.com/microsoft/copilot-for-eclipse/issues/46

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with org.eclipse.lsp4e.LSPEclipseUtils.getFile(IDocument) and toUri(IDocument), tracing how they currently use the Eclipse buffer manager. Check the IDocument adaptation behavior described in the issue and the linked Xtext PR, then verify that documents outside the buffer manager can provide a URI and IFile without breaking existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.