Jupyter Language Server Protocol Server Extension

2.3.0 · active · verified Sun Mar 29

jupyter-lsp acts as a multi-language server WebSocket proxy for Jupyter Notebook and JupyterLab servers. It enables advanced IDE-like features such as code navigation, hover suggestions, linters, and autocompletion in Jupyter environments by leveraging the Language Server Protocol (LSP). It works in conjunction with a frontend extension, typically `jupyterlab-lsp`, and specific language servers (e.g., `python-lsp-server`). The library is actively maintained, with version 2.3.0 being the current stable release, supporting Python >=3.8.

Warnings

Install

Imports

Quickstart

This quickstart guides you through installing `jupyter-lsp`, its JupyterLab frontend counterpart `jupyterlab-lsp`, and a common Python language server. After installation, a restart of JupyterLab is crucial for the extensions to be recognized. Language server configurations can then be managed through JupyterLab's settings.

# Install jupyter-lsp and the JupyterLab frontend extension
pip install jupyter-lsp jupyterlab-lsp 'jupyterlab>=4.1.0'

# Install a language server for Python (e.g., python-lsp-server)
pip install python-lsp-server

# If using other languages, install their respective LSP servers, e.g., for R:
# Rscript -e 'install.packages("languageserver")'

# After installation, restart your JupyterLab instance to enable the extensions.
# You can then verify the installation and configure language servers via:
# JupyterLab Settings -> Settings Editor -> Language Servers (Experimental)

# Example of how you might enable the server extension if not auto-detected (less common now):
# jupyter server extension enable jupyter_lsp --py --sys-prefix

# To verify server extensions are enabled (run in terminal):
# jupyter server extension list

view raw JSON →