Planned improvements to cclsp architecture
mainThe project is undergoing a refactoring process divided into two main phases to improve modularity, stability, and observability.
Phase 1: Structural Refactoring
Focuses on decomposing the monolithic lsp-client.ts into specialized modules while preserving existing behavior. Key modules being extracted include:
src/lsp/types.ts: Centralized LSP and internal types.src/lsp/json-rpc.ts: Message framing and ID correlation.src/lsp/config.ts: Configuration loading and validation.src/lsp/document-manager.ts: TrackingdidOpen,didChange, anddidCloseevents.src/lsp/server-manager.ts: Server lifecycle (spawn, restart) and adapter integration.src/lsp/diagnostics.ts: Diagnostics caching.src/lsp/operations.ts: Orchestration of LSP operations.src/tools/registry.ts: Declarative tool definitions.
Phase 2: Quality Improvements
Focuses on enhancing the developer and user experience:
- Logging: Adding a structured logger controlled by the
CCLSP_LOG_LEVELenvironment variable. - Adapter Interface: Cleaning up the adapter interface and implementing
customizeInitializeParams. - Resilience: Implementing graceful degradation so individual server failures do not crash the entire MCP process.
- Version Accuracy: Ensuring the MCP server version matches
package.json.