summaryrefslogtreecommitdiff
path: root/internal/lsp/server.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-02 13:53:29 +0200
committerPaul Buetow <paul@buetow.org>2026-03-02 13:53:29 +0200
commitabfb1964fce8f742e1b02d83f4983656c49c7b95 (patch)
tree183f74220561944d626ad44576d6ef33a818e39e /internal/lsp/server.go
parent81e79a1daf26475f020605dd92970c9bf5b112fe (diff)
lsp: extract completion/chat/codeaction server subtypes (task 406)
Diffstat (limited to 'internal/lsp/server.go')
-rw-r--r--internal/lsp/server.go35
1 files changed, 23 insertions, 12 deletions
diff --git a/internal/lsp/server.go b/internal/lsp/server.go
index 730169f..fa3b375 100644
--- a/internal/lsp/server.go
+++ b/internal/lsp/server.go
@@ -32,25 +32,18 @@ type Server struct {
configStore *runtimeconfig.Store
cfg appconfig.App
llmClient llm.Client
- llmProvider string
- altClients map[string]llm.Client
- lastInput time.Time
+ codeActionSubsystem
+ chatSubsystem
// LLM request stats
llmReqTotal int64
llmSentBytesTotal int64
llmRespTotal int64
llmRespBytesTotal int64
startTime time.Time
- // Small LRU cache for recent code completion outputs (keyed by context)
- compCache map[string]string
- compCacheOrder []string // most-recent at end; cap ~10
- pendingCompletions map[string][]CompletionItem
- configLoadOpts appconfig.LoadOptions
+ completionSubsystem
+ configLoadOpts appconfig.LoadOptions
// Outgoing JSON-RPC id counter for server-initiated requests
- nextID int64
- lastLLMCall time.Time
-
- completionsDisabled bool
+ nextID int64
// Gitignore-aware file checker (nil when disabled)
ignoreChecker *ignore.Checker
@@ -59,6 +52,24 @@ type Server struct {
handlers map[string]func(Request)
}
+type completionSubsystem struct {
+ // Small LRU cache for recent code completion outputs (keyed by context)
+ compCache map[string]string
+ compCacheOrder []string // most-recent at end; cap ~10
+ pendingCompletions map[string][]CompletionItem
+ lastLLMCall time.Time
+ completionsDisabled bool
+}
+
+type chatSubsystem struct {
+ lastInput time.Time
+}
+
+type codeActionSubsystem struct {
+ llmProvider string
+ altClients map[string]llm.Client
+}
+
// ServerOptions collects configuration for NewServer to avoid long parameter lists.
type ServerOptions struct {
LogContext bool