JupyterLab Language Server Protocol (LSP)

5.3.0 · active · verified Fri Apr 17

jupyterlab-lsp integrates Language Server Protocol (LSP) features directly into JupyterLab, providing coding assistance like autocompletion, hover documentation, linting, and refactoring. As of version 5.3.0, it supports JupyterLab 4.x and is actively maintained with regular updates focusing on compatibility and new LSP features.

Common errors

Warnings

Install

Quickstart

This Python code, when opened in a `.py` file or a notebook within JupyterLab (after `jupyterlab-lsp` and `python-lsp-server` are installed), will demonstrate LSP features. You'll see type hints, signature help, hover documentation, and autocompletion provided by the extension.

# hello_lsp.py
import os

def greet(name: str) -> str:
    """
    Returns a greeting message.
    Hover over 'greet' for documentation.
    Type 'greet(' to see signature help.
    """
    message = f"Hello, {name}!"
    # Type 'message.' to trigger autocompletion provided by LSP
    return message.upper()

if __name__ == '__main__':
    user_name = os.environ.get('USER_NAME', 'World')
    print(greet(user_name))

view raw JSON →