Registry / testing / ruff-lsp

ruff-lsp

JSON →
library0.0.62pypypiunverified

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-lsp
INSTALL
IMPORT
SIG · RUFF-LSP
R
ruff-lsp
testingpythonv0.0.62
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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.

# ruff-lsp is typically launched by an LSP-capable editor. # To run it manually (e.g., for testing or debugging): ruff-lsp
Debug
Known issues
breakingruff-lsp is officially deprecated and is being replaced by Ruff's native Rust-based language server (`ruff server`). It is recommended to migrate to `ruff server` for improved performance and ongoing support. ruff-lsp is expected to be archived with the release of Ruff 0.11.
fix
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.
affects: <=0.0.62 (all versions)
gotchaConfiguration settings for ruff-lsp are not fully compatible with the native `ruff server`. Many settings have been renamed or replaced.
fix
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.
affects: All versions when migrating to `ruff server`
gotchaWhen integrating ruff-lsp (or `ruff server`) into an editor, it may conflict with other installed Python Language Servers (e.g., Pyright, Pylsp) if not configured to defer specific capabilities.
fix
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.
affects: All versions
Errors
Common errors & fixes
[lspconfig] Cannot access configuration for ruff. Ensure this server is listed in `server_configurations.md` or added as a custom server.
Your LSP client (e.g., nvim-lspconfig) cannot find or properly interpret the configuration for `ruff-lsp` or the native `ruff` language server. This can happen if the client is outdated or the configuration path is incorrect.
fix
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.
ruff-lsp doesn't start because of errors / Source actions not appearing in VS Code integration
General misconfiguration, missing dependencies (like Ruff itself), or conflicts with other extensions/LSP servers preventing `ruff-lsp` from initializing or providing features correctly.
fix
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.
Upgrade
Version history
0.0.62latest on PyPI · released Feb 10, 2025
Audit
Dependencies
ruffrequiredruff-lsp acts as an LSP wrapper for the Ruff linter and formatter; Ruff is essential for its functionality.
pythonrequiredRequired Python version.
Agent activity
2 hits · last 30 days
node
2
Resources
ruff-lsp — pip install ruff-lsp · libregistry