From 9cae3b4218184d32033498c6b4ddc43959046cdf Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 28 Sep 2025 17:49:54 +0300 Subject: Propagate --config overrides through CLI tools and LSP reloads --- internal/hexailsp/run.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal') diff --git a/internal/hexailsp/run.go b/internal/hexailsp/run.go index 750e544..0e383ac 100644 --- a/internal/hexailsp/run.go +++ b/internal/hexailsp/run.go @@ -65,7 +65,7 @@ func RunWithFactory(logPath string, configPath string, stdin io.Reader, stdout i store := runtimeconfig.New(cfg) logContext := strings.TrimSpace(logPath) != "" loadOpts := appconfig.LoadOptions{ConfigPath: strings.TrimSpace(configPath)} - opts := makeServerOptions(cfg, logContext, client) + opts := makeServerOptions(cfg, logContext, client, loadOpts) opts.ConfigLoadOptions = loadOpts opts.ConfigStore = store server := factory(stdin, stdout, logger, opts) @@ -79,8 +79,7 @@ func RunWithFactory(logPath string, configPath string, stdin io.Reader, stdout i if newClient := buildClientIfNil(updated, nil); newClient != nil { client = newClient } - opts := makeServerOptions(updated, logContext, client) - opts.ConfigLoadOptions = loadOpts + opts := makeServerOptions(updated, logContext, client, loadOpts) opts.ConfigStore = store configurable.ApplyOptions(opts) }) @@ -144,7 +143,7 @@ func ensureFactory(factory ServerFactory) ServerFactory { } } -func makeServerOptions(cfg appconfig.App, logContext bool, client llm.Client) lsp.ServerOptions { +func makeServerOptions(cfg appconfig.App, logContext bool, client llm.Client, loadOpts appconfig.LoadOptions) lsp.ServerOptions { // Map custom actions from appconfig to lsp type var customs []lsp.CustomAction if len(cfg.CustomActions) > 0 { @@ -162,6 +161,7 @@ func makeServerOptions(cfg appconfig.App, logContext bool, client llm.Client) ls } } return lsp.ServerOptions{ + ConfigLoadOptions: loadOpts, LogContext: logContext, ConfigStore: nil, Config: &cfg, -- cgit v1.2.3