Eglot: don't watch directories that don't exist
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.
This commit is contained in:
parent
82d0b6c64e
commit
86cf9fd932
1 changed files with 3 additions and 2 deletions
|
@ -3433,8 +3433,9 @@ at point. With prefix argument, prompt for ACTION-KIND."
|
|||
(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"
|
||||
|
|
Loading…
Add table
Reference in a new issue