Language Server Protocol support#

Warning

Language Server Protocol (LSP) support for JupyterLab is an experimental feature. It is based on the jupyterlab-lsp extension. More detailed documentation can be found on their page.

JupyterLab 4.0 ships with components on both backend and frontend to lay the infrastructure for handling and communicating with language servers.

This means that other extensions can be built on top of JupyterLab’s services to provide LSP features for notebooks and files.

The LSP service is disabled by default, it can be enabled by togging the Activate option in the Language Servers section of the setting page.

Requirements#

By default JupyterLab does not come with any language servers preinstalled; you need to install the servers yourself. Supported language servers and the suggested package managers to install them are listed in the tables below:

Notebook-optimized Language Servers#

Languages

Implementation

Installation

python

jedi-language-server

pip: pip install -U jedi-language-server
conda: conda install -c conda-forge jedi-language-server

python

pylsp

pip: pip install 'python-lsp-server[all]'
conda: conda install -c conda-forge python-lsp-server

julia

julia-language-server

julia: using Pkg; Pkg.add("LanguageServer")

r

r-languageserver

cran: install.packages("languageserver")
conda: conda install -c conda-forge r-languageserver

robotframework

robotframework_ls

pip: pip install robotframework-lsp
conda: conda install -c conda-forge robotframework-lsp

NodeJS-based Language Servers#

Languages

Implementation

Installation

bash
sh

bash-language-server

npm: npm install --save-dev bash-language-server
yarn: yarn add --dev bash-language-server

dockerfile

dockerfile-language-server-nodejs

npm: npm install --save-dev dockerfile-language-server-node
yarn: yarn add --dev dockerfile-language-server-node

python

pyright

npm: npm install --save-dev pyright
yarn: yarn add --dev pyright

sql

sql-language-server

npm: npm install --save-dev sql-language-server
yarn: yarn add --dev sql-language-server

javascript
typescript

typescript-language-server

npm: npm install --save-dev typescript-language-server
yarn: yarn add --dev typescript-language-server

markdown
ipythongfm
gfm

unified-language-server

npm: npm install --save-dev unified-language-server
yarn: yarn add --dev unified-language-server

css
less
scss

vscode-css-languageserver-bin

npm: npm install --save-dev vscode-css-languageserver-bin
yarn: yarn add --dev vscode-css-languageserver-bin

html

vscode-html-languageserver-bin

npm: npm install --save-dev vscode-html-languageserver-bin
yarn: yarn add --dev vscode-html-languageserver-bin

json

vscode-json-languageserver-bin

npm: npm install --save-dev vscode-json-languageserver-bin
yarn: yarn add --dev vscode-json-languageserver-bin

yaml

yaml-language-server

npm: npm install --save-dev yaml-language-server
yarn: yarn add --dev yaml-language-server

For other community-supported language servers, see the extension documentation.

Settings#

The settings for language servers can be found on the settings page of JupyterLab (Settings > Settings Editor > Language Servers).

  • Activate: this option allows users to enable or disable the LSP services.

  • Language Server: this section allows users to configure the installed language servers.

../_images/settings.png

Language servers setting page.#