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
org.eclipse.lsp4e.LSPEclipseUtils.getFile(IDocument)andorg.eclipse.lsp4e.LSPEclipseUtils.toUri(IDocument)uses the eclipse buffer allocated by buffer manager toIDocumentto determine thejava.netURIandorg.eclipse.core.resources.IFile.Some framework like
Xtextdoes not connect their document to buffer manager. SoLSPEclipseUtilsreturns null for URI and IFile in such cases.So we can try to adapt the
IDocumenttoURIandIFile. 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
URIandIFile. Which is currently failing for XtextDocuments and lacking the copilot completion support for DSL editors.microsoft/copilot-eclipse-feedback#44