ruff-lsp is a Language Server Protocol (LSP) implementation for Ruff, an extremely fast Python linter and code formatter. It enables Ruff to be integrated with any editor that supports the LSP, providing features like surfacing diagnostics and offering code actions to fix them. The library is currently at version 0.0.62, with releases often coinciding with updates to the underlying Ruff tool. However, ruff-lsp is officially deprecated in favor of Ruff's native Rust-based language server, `ruff server`.
pip install ruff-lspNo compatibility data collected yet for this library.
ruff-lsp functions as a Language Server, meant to be launched and managed by an editor or IDE supporting the Language Server Protocol. It is not designed for direct programmatic import and use within Python scripts. The command above starts the LSP server process, which editors connect to.
Migrate your editor's LSP configuration to use `ruff server`. Refer to Ruff's official documentation for migration guides and setup instructions for your specific editor. This often involves ensuring you have a recent version of Ruff installed (`pip install --upgrade ruff`) and configuring your editor's LSP client to use the `ruff server` command.
Consult the Ruff migration guide from `ruff-lsp` to `ruff server` to update your configuration files (e.g., `pyproject.toml` or editor-specific settings). Unsupported settings should be removed, and new granular settings should be adopted.
Configure your editor's LSP client to explicitly specify which LSP handles which capabilities (e.g., `textDocument/hover`, `textDocument/completion`). For instance, you might defer auto-completion and navigation to another LSP while letting Ruff handle linting and formatting.
Update your LSP client plugin (e.g., `nvim-lspconfig`). Ensure your editor's LSP configuration for `ruff` (or `ruff-lsp` if still using it) matches the recommended setup in Ruff's official editor integration documentation. Verify that `ruff` is installed and accessible in your environment.
Check your editor's LSP logs for detailed error messages. Ensure `ruff` and `ruff-lsp` are installed and accessible in the Python environment used by your editor. Disable other potentially conflicting Python linting/formatting extensions or LSP servers to isolate the issue. Confirm your editor's `ruff-lsp` settings (or Ruff extension settings for VS Code) are correct.