summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-08-16 23:58:40 +0300
committerPaul Buetow <paul@buetow.org>2025-08-16 23:58:40 +0300
commit6a1d48036105e92193aef11a15a77a569eeb1562 (patch)
tree96bae3cf3e46ab96d6285a18739f3da82b0da7f6 /cmd
parent37d0049e7a7b55d40af6da1a884810a543fead22 (diff)
lsp: refactor NewServer to use options struct
- Introduce ServerOptions to reduce constructor parameter count - Update main.go call site; preserve defaults and behavior - Build and run tests
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hexai/main.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/hexai/main.go b/cmd/hexai/main.go
index 65cbfdf..8e446a3 100644
--- a/cmd/hexai/main.go
+++ b/cmd/hexai/main.go
@@ -63,7 +63,15 @@ func main() {
}
}
- server := lsp.NewServer(os.Stdin, os.Stdout, logger, *logPath != "", cfg.MaxTokens, cfg.ContextMode, cfg.ContextWindowLines, cfg.MaxContextTokens, cfg.NoDiskIO, client)
+ server := lsp.NewServer(os.Stdin, os.Stdout, logger, lsp.ServerOptions{
+ LogContext: *logPath != "",
+ MaxTokens: cfg.MaxTokens,
+ ContextMode: cfg.ContextMode,
+ WindowLines: cfg.ContextWindowLines,
+ MaxContextTokens: cfg.MaxContextTokens,
+ NoDiskIO: cfg.NoDiskIO,
+ Client: client,
+ })
if err := server.Run(); err != nil {
logger.Fatalf("server error: %v", err)
}