feat(lsp): implement Phase 2 LSP Client - #7
Merged
Conversation
Complete LSP client implementation with JSON-RPC 2.0 transport: Transport Layer: - Header-content message format parsing (Content-Length) - Async stdio communication with BufReader/BufWriter - Message framing and buffering LSP Client Core: - Concurrent request handling with tokio channels - Atomic request ID generation - Background message loop with tokio::select! - Timeout support for all requests - Pending request tracking Lifecycle Management: - Server spawning with tokio::process - Initialize/initialized handshake - Capability negotiation (position encoding) - Graceful shutdown sequence Position Encoding: - MCP (1-based) <-> LSP (0-based) conversion - UTF-8/UTF-16/UTF-32 encoding support - Multibyte character handling (emoji, CJK) Testing: - 25 tests passing (22 unit + 3 CLI) - Position encoding: 95% coverage - JSON-RPC types: 80% coverage Quality Reviews: - Performance: APPROVED (Grade B+) - Security: APPROVED (LOW risk) - Testing: APPROVED - Code Review: APPROVED
- Add const fn where applicable (encoding, translator, lifecycle, tools) - Use inline format arguments for cleaner code - Add allow attributes for dead_code on unused items (will be used later) - Add allow attributes for unwrap_used in test modules - Fix expect_used warning with explicit allow attribute - Fix needless_pass_by_value for logging init function - Fix doc_markdown warning for environment variable
Replace rustsec/audit-check@v2 with cargo-deny for more reliable and comprehensive dependency checks (advisories, licenses, bans, sources). Add deny.toml configuration with RUSTSEC-2024-0436 ignored (paste crate unmaintained - transitive dependency from rmcp).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete LSP client implementation with JSON-RPC 2.0 transport layer, enabling communication with language servers.
Components Implemented
Transport Layer (
lsp/transport.rs)LSP Client Core (
lsp/client.rs)tokio::select!Lifecycle Management (
lsp/lifecycle.rs)tokio::processJSON-RPC Types (
lsp/types.rs)Position Encoding (
bridge/encoding.rs)Quality Reviews
Test Plan
cargo test)cargo clippy)Changes
crates/mcpls-core/src/lsp/types.rsNext Steps
After merge, Phase 3 (Document State Management) will implement:
didOpen/didChange/didClose