@@ -5,6 +5,7 @@ import (
10 "github.com/charmbracelet/crush/internal/config"
11 "github.com/charmbracelet/crush/internal/config"
@@ -58,16 +59,25 @@ func (app *App) initLSPClients(ctx context.Context) {
58 updateLSPState(name, lsp.StateDisabled, nil, nil, 0)
59 updateLSPState(name, lsp.StateDisabled, nil, nil, 0)
63+ var wg sync.WaitGroup
61 for name, server := range filtered {
64 for name, server := range filtered {
62 if app.config.Options.AutoLSP != nil && !*app.config.Options.AutoLSP && !slices.Contains(userConfiguredLSPs, name) {
65 if app.config.Options.AutoLSP != nil && !*app.config.Options.AutoLSP && !slices.Contains(userConfiguredLSPs, name) {
63 slog.Debug("Ignoring non user-define LSP client due to AutoLSP being disabled", "name", name)
66 slog.Debug("Ignoring non user-define LSP client due to AutoLSP being disabled", "name", name)
66− go app.createAndStartLSPClient(
70+ app.createAndStartLSPClient(
67− ctx, name,
71+ ctx, name,
68− toOurConfig(server),
72+ toOurConfig(server),
69− slices.Contains(userConfiguredLSPs, name),
73+ slices.Contains(userConfiguredLSPs, name),
79+ if err := app.AgentCoordinator.UpdateModels(ctx); err != nil {
80+ slog.Error("Failed to refresh tools after LSP startup", "error", err)