Language servers#

By default jupyter-lsp does not come with any language servers preinstalled. However, we will try to use them if they are installed and we know about them (i.e. someone contributed a full specification).

You can disable auto-detection by configuring autodetect

You can add another language server for languages that are not listed on this page:

  • using a minimal JSON or Python configuration file (good for experimenting or configuring a niche server), or

  • contributing a full specification (to enable better integration and help other users of the same language)

The existing language servers are listed on the official list and on the community-curated list.

For the language servers in the tables below, use one of the suggested package managers to install them: these implementations are tested to work with jupyter-lsp.

Notebook-optimized Language Servers#

These servers have support for notebooks and file editors. The pylsp, and r-languageserver, and robotframework_ls implementatoons are well-tested, while jedi and Julia servers are experimental. If you choose to install multiple language servers for the same language, the one with the highest priority (which can be set in the Advanced Settings Editor) will be used.

Languages Implementation Installation
python
jedi-language-server
  • pip: pip install -U jedi-language-server
  • conda: conda install -c conda-forge jedi-language-server
julia
julia-language-server
  • julia: using Pkg; Pkg.add("LanguageServer")
python
pylsp
  • pip: pip install 'python-lsp-server[all]'
  • conda: conda install -c conda-forge python-lsp-server
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

The Scala language server (metals) is not currently auto-detected, but can be configured as demonstrated in the configuration example.

If you plan to add a custom language server for the use with notebooks, please note that a complete set of information should be provided by the kernel, as described in making custom servers work with notebooks.

NodeJS-based Language Servers#

These servers have mostly been tested with file editors.

Languages Implementation Installation
bash
sh
bash-language-server
  • npm: npm install --save-dev bash-language-server
  • yarn: yarn add --dev bash-language-server
  • jlpm: jlpm add --dev bash-language-server
dockerfile
dockerfile-language-server-nodejs
  • npm: npm install --save-dev dockerfile-language-server-nodejs
  • yarn: yarn add --dev dockerfile-language-server-nodejs
  • jlpm: jlpm add --dev dockerfile-language-server-nodejs
python
pyright
  • npm: npm install --save-dev pyright
  • yarn: yarn add --dev pyright
  • jlpm: jlpm add --dev pyright
sql
sql-language-server
  • npm: npm install --save-dev sql-language-server
  • yarn: yarn add --dev sql-language-server
  • jlpm: jlpm add --dev sql-language-server
javascript
jsx
typescript
typescript-jsx
typescriptreact
javascriptreact
typescript-language-server
  • npm: npm install --save-dev typescript-language-server
  • yarn: yarn add --dev typescript-language-server
  • jlpm: jlpm 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
  • jlpm: jlpm 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
  • jlpm: jlpm 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
  • jlpm: jlpm 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
  • jlpm: jlpm 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
  • jlpm: jlpm add --dev yaml-language-server

NodeJS (preferrably even-numbered an Active or Maintenance Long Term Support release) is a prerequisite for installation of any of the above language servers; you can get it with:

conda install -c conda-forge nodejs
# or one of the following, as an administrator
choco install nodejs            # Windows with Chocolatey
sudo apt-get install nodejs     # Debian/Ubuntu
sudo brew install nodejs        # MacOS with Homebrew
sudo dnf install nodejs         # Fedora
sudo yum install nodejs         # RHEL/CentOS

Example: Getting All the NodeJS-based Language Servers#

A number of language servers are built on the reference implementation, powered by NodeJS. The most reliable place to install these is in a node_modules in the directory where you launch jupyter lab.

For example, to install all the servers which are tested as part of jupyterlab-lsp:

jlpm add --dev  \
    bash-language-server \
    dockerfile-language-server-nodejs \
    pyright \
    sql-language-server \
    typescript-language-server \
    unified-language-server \
    vscode-css-languageserver-bin \
    vscode-html-languageserver-bin \
    vscode-json-languageserver-bin \
    yaml-language-server

This will create (or add to):

  • package.json (check this in!)

  • yarn.lock (check this in!)

  • node_modules/ (add to your VCS ignore file)

If you wish to install these someplace else, you may need to specify where you install them with extra_node_roots.

Other scientific languages#

These servers have been mostly tested with file editor.

Languages Implementation Installation
tex
latex
texlab
  • conda: conda install -c conda-forge texlab chktex

Example: Getting a \(\LaTeX\) stack#

conda install -y conda-forge tectonic texlab chktex

This will install:

  • tectonic, a cross-platform \(\LaTeX\) processing tool

    • note, it will download a large number of packages when first executed

  • texlab, a Language Server for .tex files that supports completion and reference navigation

  • chktex, a .tex style checker

Troubleshooting#

r-languageserver

Rscript not found. Please ensure that RScript executable is in the PATH; this should happen automatically when using Linux, Mac OS or Conda, but will require manual configuration when using the default R installer on Windows. For more details please consult documentation: https://cran.r-project.org/bin/windows/base/rw-FAQ.html#Rcmd-is-not-found-in-my-PATH_0021 If Rscript is already in the PATH, you can check whether the language server package is properly installed with: Rscript -e "cat(system.file(package='languageserver'))" which should return the path to the installed package.

texlab

texlab not found. Please ensure that texlab executable is in the PATH; this should happen automatically when installing texlab from Conda, but may require manual configuration of PATH environment variable if you compiled texlab from source. You can ensure check if texlab is in the PATH, by running: which texlab which should return the path to the executable (if found).