emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot e498cb171b 07/33: Per #697: Use project-files to


From: Stefan Kangas
Subject: [elpa] externals/eglot e498cb171b 07/33: Per #697: Use project-files to know which directory watchers to skip
Date: Sat, 8 Jan 2022 12:30:48 -0500 (EST)

branch: externals/eglot
commit e498cb171bb07ec36880a2494aafc8acb1cc34ca
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Per #697: Use project-files to know which directory watchers to skip
    
    The directory-finding logic is probably a bit slower than using
    eglot--directories-recursively, but since it honours `.gitignores` and
    ignores more directories it's much faster overall.  And guaranteed to
    create less watchers.
    
    Thanks to Dmitry Gutov <dgutov@yandex.ru> for the idea.
    
    * eglot.el (eglot--directories-recursively): Remove.
---
 eglot.el | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/eglot.el b/eglot.el
index 4c47ad004b..4ead874eec 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2777,7 +2777,9 @@ at point.  With prefix argument, prompt for ACTION-KIND."
                    (eglot--glob-compile globPattern t t))
                  watchers))
          (dirs-to-watch
-          (eglot--directories-recursively default-directory)))
+          (delete-dups (mapcar #'file-name-directory
+                               (project-files
+                                (eglot--project server))))))
     (cl-labels
         ((handle-event
           (event)
@@ -2878,15 +2880,6 @@ If NOERROR, return predicate, else erroring function."
   (when (eq ?! (aref arg 1)) (aset arg 1 ?^))
   `(,self () (re-search-forward ,(concat "\\=" arg)) (,next)))
 
-(defun eglot--directories-recursively (&optional dir)
-  "Because `directory-files-recursively' isn't complete in 26.3."
-  (cons (setq dir (expand-file-name (or dir default-directory)))
-        (cl-loop with default-directory = dir
-                 with completion-regexp-list = '("^[^.]")
-                 for f in (file-name-all-completions "" dir)
-                 if (and (file-directory-p f) (not (string= "node_modules/" 
f)))
-                 append (eglot--directories-recursively f))))
-
 
 ;;; Rust-specific
 ;;;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]