summaryrefslogtreecommitdiff
path: root/internal/lsp/completion_cache_test.go
AgeCommit message (Collapse)Author
2026-06-11Refactor lsp.Server God Object: extract chat and completion subsystemsPaul Buetow
The Server type accumulated two large, tangled feature subsystems (in-editor chat and code completion) alongside its core LSP dispatch role. Pull them into cohesive types that own their state and logic while delegating shared infrastructure back to Server via a back-reference. - Add completionService (completion_service.go): owns the completion cache/throttle state (completionState) and all completion request-handling logic (handleCompletion, plan/jobs/execute, provider-native path, post-processing, message building, prefix heuristics). Methods moved off Server in handlers_completion.go to completionService. - Add chatService (chat_service.go + chat_handlers.go): owns the input-activity clock (lastInput, with its own mutex instead of Server.mu) and all in-editor chat logic (detection, transcript history, message building, edit application, inline prompts) plus the slash-command handlers (chat_commands.go). - Server now holds chat/completion fields, wires them in NewServer, and delegates (dispatch table, didChange, debounce gate) to them. Thin Server shims preserve the existing completion-state API for callers/tests. Pure refactor: no behavior or LSP protocol changes. Tests adjusted only to reach the relocated methods/state via the services. All tests pass with -race; coverage 86.1%. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2025-09-28Improve multi-provider completion streaming and CLI selector flagsPaul Buetow
2025-09-24Add runtime config store and reload commandPaul Buetow
2025-09-06use gofumptPaul Buetow
2025-08-31module: set module path to codeberg.org/snonux/hexai; update imports; docs: ↵v0.3.4Paul Buetow
add go install instructions
2025-08-29lsp: refactor dispatch to handler map; split handlers into feature files ↵Paul Buetow
(completion, codeaction, init, document); decompose completion logic into small helpers; update review checklist
2025-08-28copilot: add session token + codex code completion; lsp: prefer native ↵v0.3.0Paul Buetow
CodeCompleter with chat fallback; remove obsolete throttle path; add tests; bump version to 0.3.0
2025-08-20lsp: add tiny LRU cache for last 10 completions; ignore trailing whitespace ↵Paul Buetow
in cache key; log cache hits; report busy with isIncomplete to prompt client retry