Expand description
LSP protocol handlers.
This module contains all Language Server Protocol request handlers for deps-lsp. Each handler is responsible for a specific LSP feature:
completion: Package name and version completionshover: Hover documentation with crate metadatainlay_hints: Inline version annotationsdiagnostics: Outdated/yanked version warningscode_actions: Quick fixes (e.g., “Update to latest version”)
§Handler Architecture
Handlers delegate to ecosystem-specific implementations via the
Ecosystem trait. Each ecosystem (Cargo, npm, PyPI) provides its own
implementation of LSP features.
The general flow is:
- Extract document state and ecosystem from
ServerState - Delegate to
ecosystem.generate_*()methods - Return LSP-compliant response types
- Gracefully degrade on errors (never panic)
§Examples
use deps_lsp::document::ServerState;
use std::sync::Arc;
let state = Arc::new(ServerState::new());
// Handlers use state.get_document() and ecosystem_registryModules§
- code_
actions - Code actions handler using ecosystem trait delegation.
- completion
- Completion handler implementation.
- diagnostics
- Diagnostics handler using ecosystem trait delegation.
- hover
- Hover handler using ecosystem trait delegation.
- inlay_
hints - Inlay hints handler using ecosystem trait delegation.