Summary
The LSP module's internal structure could be improved with better abstraction boundaries.
Findings
Critical
- C6: Compute functions not abstracted (
internal/lsp/*.go)
Handler directly calls compute functions with no abstraction layer. No separation of request handling from computation logic.
Fix: Create LSPAnalyzer interface encapsulating compute functions.
High
- H16: Monolithic handler dispatch (
internal/lsp/handler.go:26-61)
Large switch statement mixing request marshaling, error handling, and computation.
Fix: Map-based dispatch or handler registry pattern.
Medium
- M11: Document manager exposes raw state (
internal/lsp/document.go:30-60)
Raw documentState struct fields accessed directly by handlers with no abstraction.
Fix: Create Document interface with AST(), Errors(), Content() methods.
Summary
The LSP module's internal structure could be improved with better abstraction boundaries.
Findings
Critical
internal/lsp/*.go)Handler directly calls compute functions with no abstraction layer. No separation of request handling from computation logic.
Fix: Create
LSPAnalyzerinterface encapsulating compute functions.High
internal/lsp/handler.go:26-61)Large switch statement mixing request marshaling, error handling, and computation.
Fix: Map-based dispatch or handler registry pattern.
Medium
internal/lsp/document.go:30-60)Raw
documentStatestruct fields accessed directly by handlers with no abstraction.Fix: Create
Documentinterface withAST(),Errors(),Content()methods.