deps_lsp/handlers/mod.rs
1//! LSP protocol handlers.
2//!
3//! This module contains all Language Server Protocol request handlers for
4//! deps-lsp. Each handler is responsible for a specific LSP feature:
5//!
6//! - [`completion`]: Package name and version completions
7//! - [`hover`]: Hover documentation with crate metadata
8//! - [`inlay_hints`]: Inline version annotations
9//! - [`diagnostics`]: Outdated/yanked version warnings
10//! - [`code_actions`]: Quick fixes (e.g., "Update to latest version")
11//!
12//! # Handler Architecture
13//!
14//! Handlers delegate to ecosystem-specific implementations via the
15//! `Ecosystem` trait. Each ecosystem (Cargo, npm, PyPI) provides its own
16//! implementation of LSP features.
17//!
18//! The general flow is:
19//! 1. Extract document state and ecosystem from `ServerState`
20//! 2. Delegate to `ecosystem.generate_*()` methods
21//! 3. Return LSP-compliant response types
22//! 4. Gracefully degrade on errors (never panic)
23//!
24//! # Examples
25//!
26//! ```no_run
27//! use deps_lsp::document::ServerState;
28//! use std::sync::Arc;
29//!
30//! let state = Arc::new(ServerState::new());
31//! // Handlers use state.get_document() and ecosystem_registry
32//! ```
33
34pub mod code_actions;
35pub mod completion;
36pub mod diagnostics;
37pub mod hover;
38pub mod inlay_hints;