diff --git a/internal/lsp/watcher/watcher.go b/internal/lsp/watcher/watcher.go index 18b790349a10f0827f45f8ccb9fb6968980a9d4e..139d144e1e5c65c11962e73201b42b15cd09f98a 100644 --- a/internal/lsp/watcher/watcher.go +++ b/internal/lsp/watcher/watcher.go @@ -28,6 +28,13 @@ type Client struct { registrations *csync.Slice[protocol.FileSystemWatcher] } +func init() { + // Ensure the watcher is initialized with a reasonable file limit + if _, err := Ulimit(); err != nil { + slog.Error("Error setting file limit", "error", err) + } +} + // New creates a new workspace watcher for the given client. func New(name string, client *lsp.Client) *Client { return &Client{