summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-02 14:27:34 +0200
committerPaul Buetow <paul@buetow.org>2026-03-02 14:27:34 +0200
commit5b04524a7c134e101da1bc7e6a99402ca07ad4cc (patch)
treef67d0ac71ed848c6cee263965295f9354f2dfeb7
parent4c562f926e13de8d040029e954b7cf407134a8bb (diff)
hexailsp: add ConfigurableServerRunner for runtime ApplyOptions (task 408)
-rw-r--r--internal/hexailsp/run.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/hexailsp/run.go b/internal/hexailsp/run.go
index 3c86414..09889ec 100644
--- a/internal/hexailsp/run.go
+++ b/internal/hexailsp/run.go
@@ -23,6 +23,12 @@ import (
// ServerRunner is the minimal interface satisfied by lsp.Server.
type ServerRunner interface{ Run() error }
+// ConfigurableServerRunner supports runtime option updates.
+type ConfigurableServerRunner interface {
+ ServerRunner
+ ApplyOptions(lsp.ServerOptions)
+}
+
// ServerFactory creates a ServerRunner. Default uses lsp.NewServer.
type ServerFactory func(r io.Reader, w io.Writer, logger *log.Logger, opts lsp.ServerOptions) ServerRunner
@@ -81,7 +87,7 @@ func RunWithFactory(logPath string, configPath string, stdin io.Reader, stdout i
opts.ConfigLoadOptions = loadOpts
opts.ConfigStore = store
server := factory(stdin, stdout, logger, opts)
- if configurable, ok := server.(interface{ ApplyOptions(lsp.ServerOptions) }); ok {
+ if configurable, ok := server.(ConfigurableServerRunner); ok {
store.Subscribe(func(oldCfg, newCfg appconfig.App) {
updated := newCfg
normalizeLoggingConfig(&updated)