@@ -7,6 +7,7 @@ import (
77 "log/slog"
88 "sort"
99 "strings"
10+ "sync"
1011 "time"
1112
1213 "charm.land/fantasy"
@@ -72,12 +73,21 @@ func waitForLSPDiagnostics(
7273 return
7374 }
7475
76+ waitCtx, cancel := context.WithTimeout(ctx, timeout)
77+ defer cancel()
78+
79+ var wg sync.WaitGroup
7580 for client := range manager.Clients().Seq() {
7681 if !client.HandlesFile(filepath) {
7782 continue
7883 }
79− client.WaitForDiagnostics(ctx, timeout)
84+ wg.Add(1)
85+ go func() {
86+ defer wg.Done()
87+ client.WaitForDiagnostics(waitCtx, timeout)
88+ }()
8089 }
90+ wg.Wait()
8191}
8292
8393// notifyLSPs notifies LSP servers that a file has changed and waits for