Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-dev] Get hold of the Resource of a GenericEditor Document

Hi,

On Fri, Jan 15, 2021 at 11:05 AM Christoph Läubrich <laeubi@xxxxxxxxxxxxxx> wrote:
I'm currently investigate extending the GenericEditor

As mentioned elsewhere, I recommend you start directly by implementing a language server and binding it to Generic Editor with LSP4E. Although the first steps are not well documented and may seem trickier than using Generic Editor extensions, once they're done, they'll unleash a ROI and some level of reusability and accessibility to external contriutors that's tremendously higher than what you'll achieve with Eclipse APIs & Generic Editor.
 
but found that
from time to time I need to get the resource that is currently edited.

Then main way to get the Resource from a document I'm aware of is to query the TextFileBuffer, as done in https://git.eclipse.org/c/lsp4e/lsp4e.git/tree/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LSPEclipseUtils.java#n782 and https://git.eclipse.org/c/lsp4e/lsp4e.git/tree/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LSPEclipseUtils.java#n283 .

HTH

Back to the top