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//! - [`code_lens`]: "Update N outdated dependencies" document-scoped lens
12//! - [`document_link`]: Clickable references to other files (e.g. pip's `-r`/`-c`)
13//!
14//! # Handler Architecture
15//!
16//! Handlers delegate to ecosystem-specific implementations via the
17//! `Ecosystem` trait. Each ecosystem (Cargo, npm, PyPI) provides its own
18//! implementation of LSP features.
19//!
20//! The general flow is:
21//! 1. Extract document state and ecosystem from `ServerState`
22//! 2. Delegate to `ecosystem.generate_*()` methods
23//! 3. Return LSP-compliant response types
24//! 4. Gracefully degrade on errors (never panic)
25//!
26//! # Examples
27//!
28//! ```no_run
29//! use deps_lsp::document::ServerState;
30//! use std::sync::Arc;
31//!
32//! let state = Arc::new(ServerState::new());
33//! // Handlers use state.get_document() and ecosystem_registry
34//! ```
35
36pub mod code_actions;
37pub mod code_lens;
38pub mod completion;
39pub mod diagnostics;
40pub mod document_link;
41pub mod hover;
42pub mod inlay_hints;