fix: add back init setting ulimit

Carlos Alexandro Becker created

this was removed in a merge conflict in #1011

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

Change summary

internal/lsp/watcher/watcher.go | 7 +++++++
1 file changed, 7 insertions(+)

Detailed changes

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{