project-files isn't guaranteed to return existing files, so better
check if they exist because placing a watcher on them.
Originally reported at:
https://github.com/joaotavora/eglot/issues/1198
* lisp/progmodes/eglot.el (eglot-register-capability
workspace/didChangeWatchedFiles): Check if directories exist.
(unwind-protect
(progn
(dolist (dir dirs-to-watch)
- (push (file-notify-add-watch dir '(change) #'handle-event)
- (gethash id (eglot--file-watches server))))
+ (when (file-readable-p dir)
+ (push (file-notify-add-watch dir '(change) #'handle-event)
+ (gethash id (eglot--file-watches server)))))
(setq
success
`(:message ,(format "OK, watching %s directories in %s watchers"