@@ -5,17 +5,14 @@ import (
55 "log/slog"
66 "time"
77
8− "github.com/charmbracelet/crush/internal/config"
98 "github.com/charmbracelet/crush/internal/log"
109 "github.com/charmbracelet/crush/internal/lsp"
1110 "github.com/charmbracelet/crush/internal/lsp/watcher"
1211)
1312
1413func (app *App) initLSPClients(ctx context.Context) {
15− cfg := config.Get()
16−
1714 // Initialize LSP clients
18− for name, clientConfig := range cfg.LSP {
15+ for name, clientConfig := range app.config.LSP {
1916 // Start each client initialization in its own goroutine
2017 go app.createAndStartLSPClient(ctx, name, clientConfig.Command, clientConfig.Args...)
2118 }
@@ -39,7 +36,7 @@ func (app *App) createAndStartLSPClient(ctx context.Context, name string, comman
3936 defer cancel()
4037
4138 // Initialize with the initialization context
42− _, err = lspClient.InitializeLSPClient(initCtx, config.Get().WorkingDir())
39+ _, err = lspClient.InitializeLSPClient(initCtx, app.config.WorkingDir())
4340 if err != nil {
4441 slog.Error("Initialize failed", "name", name, "error", err)
4542 // Clean up the client to prevent resource leaks
@@ -92,15 +89,14 @@ func (app *App) runWorkspaceWatcher(ctx context.Context, name string, workspaceW
9289 app.restartLSPClient(ctx, name)
9390 })
9491
95− workspaceWatcher.WatchWorkspace(ctx, config.Get().WorkingDir())
92+ workspaceWatcher.WatchWorkspace(ctx, app.config.WorkingDir())
9693 slog.Info("Workspace watcher stopped", "client", name)
9794}
9895
9996// restartLSPClient attempts to restart a crashed or failed LSP client
10097func (app *App) restartLSPClient(ctx context.Context, name string) {
10198 // Get the original configuration
102− cfg := config.Get()
103− clientConfig, exists := cfg.LSP[name]
99+ clientConfig, exists := app.config.LSP[name]
104100 if !exists {
105101 slog.Error("Cannot restart client, configuration not found", "client", name)
106102 return