jupyter-lsp / jupyterlab-lsp

Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
https://jupyterlab-lsp.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.81k stars 148 forks source link

Support for Autocomplete in JupyterLab Real-Time Collaboration (RTC) Environment #1033

Open avneeshn opened 9 months ago

avneeshn commented 9 months ago

Background

Hello We are trying to build an SQL editor client for our users in the form of a JupyterLab extension. We are using jupyterlab-lsp to provide editing capabilities inside notebook cells (P.S. thank you for the amazing work your team is doing, your extension is super helpful!).

Question

I wanted to ask about the autocomplete capability provided by LSP.

We are using @joe-re/sql-language-server as a language-server running in the background. We wanted to provide autocomplete capability to our users inside JupyterLab (RTC)[https://github.com/jupyterlab/jupyter-collaboration] environment. However, there are two cases which make the problem peculiar:

  1. We want different users to be able to use the same notebook (but different cells) and receive autocomplete suggestions at the same time.
  2. We want those users to be able to connect to different SQL engines (I believe sql-language-server has support for multiple data connections + it provides a way to shift between those connections) so that different users get separate autocomplete suggestions at the same time.

Since jupyterlab-lsp provides the autocomplete capability by communicating with language-server, I was wondering is such a solution possible in JupyterLab's RTC environment?

Further, do you know if such a solution is possible if we directly communicate with the sql-language-server (skipping the jupyterlab-lsp layer)?

Thanks a lot in advance. Your help will be greatly appreciated!

krassowski commented 8 months ago

Yes, this might be possible in the future, but not out of the box now. In the single jupyter-server RTC scenario (a) each user could connect to a new LSP server instance and (b) each user could modify the settings. Both (a) and (b) would need to be implemented, with (b) possibly being a feature of jupyter-collaboration.

Further, do you know if such a solution is possible if we directly communicate with the sql-language-server (skipping the jupyterlab-lsp layer)?

Possibly, but it will come with its own headaches.