jupyterlab-lsp
jupyterlab-lsp copied to clipboard
Activate Jupyterlab-lsp within my extension
I am currently building an extension which includes components hosting code mirror editor (@jupyterlab/codemirror). According to the doc https://github.com/jupyter-lsp/jupyterlab-lsp/blob/master/docs/Extending.ipynb, I thought jupyterlap-lsp should be supported by default. But it turns out not. If I press tab outside my extension(just open the file in document widget), jupyterlab-lsp is activated
Reading through the document, I don't find a solution how to integrate jupyterlab-lsp with my extension.
Any hint what I should do here?
This would be... Not very easy today. You'd need to mirror the adapter machinery for Editor or Notebook from this repo.
It's a bit of a yak shave: we'd probably want to demonstrate this with another core widget, e.g. the settings JSON editor, but would want in-browser language servers.
Thanks for the interest!
If your widget implements IDocumentWidget<FileEditor>
interface, and you have a tracker implementing IWidgetTracker<IDocumentWidget<FileEditor>>
interface you could re-use the registration code linked below:
https://github.com/jupyter-lsp/jupyterlab-lsp/blob/0cff6b9cd7dab4d44f877cf7bacc91bf72c6ec4e/packages/jupyterlab-lsp/src/adapters/file_editor/index.ts#L1-L43
I think we do not export FileEditorAdapter
, but we can include it in the roadmap for the 4.0 version (https://github.com/jupyter-lsp/jupyterlab-lsp/issues/742). The interface of ILSPAdapterManager
will likely be subject to some changes in 4.0 too.
Thanks for quick response! It will be great if we could get it work soon. I will seek a work-around for now