[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 25d20c73cf 05/33: Fix #697, #645: Again speed up
From: |
Stefan Kangas |
Subject: |
[elpa] externals/eglot 25d20c73cf 05/33: Fix #697, #645: Again speed up directory watching |
Date: |
Sat, 8 Jan 2022 12:30:48 -0500 (EST) |
branch: externals/eglot
commit 25d20c73cf317f7d629dd215c8c22b185631551f
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Fix #697, #645: Again speed up directory watching
Previously, given a number of globs, Eglot would try to place system
watchers only in those subdirectories that could potentially be
matched by a glob. This meant traversing the whole tree, which could
be impractical. Just place watchers in every subdirectory of the
project (you may run out of watchers).
* eglot.el (eglot-register-capability): Simplify.
(eglot--files-recursively): Delete.
(eglot--directories-recursively): Fix.
---
eglot.el | 29 +++--------------------------
1 file changed, 3 insertions(+), 26 deletions(-)
diff --git a/eglot.el b/eglot.el
index a739419e9d..706fa92522 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2777,7 +2777,7 @@ at point. With prefix argument, prompt for ACTION-KIND."
(eglot--glob-compile globPattern t t))
watchers))
(dirs-to-watch
- (eglot--directories-matched-by-globs default-directory globs)))
+ (eglot--directories-recursively default-directory)))
(cl-labels
((handle-event
(event)
@@ -2878,37 +2878,14 @@ If NOERROR, return predicate, else erroring function."
(when (eq ?! (aref arg 1)) (aset arg 1 ?^))
`(,self () (re-search-forward ,(concat "\\=" arg)) (,next)))
-(defun eglot--files-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 (file-directory-p f) append (eglot--files-recursively f)
- else collect (expand-file-name f))))
-
(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 (file-directory-p f) append (eglot--files-recursively f)
- else collect (expand-file-name f))))
-
-(defun eglot--directories-matched-by-globs (dir globs)
- "Discover subdirectories of DIR with files matched by one of GLOBS.
-Each element of GLOBS is either an uncompiled glob-string or a
-compiled glob."
- (setq globs (cl-loop for g in globs
- collect (if (stringp g) (eglot--glob-compile g t t) g)))
- (cl-loop for f in (eglot--files-recursively dir)
- for fdir = (file-name-directory f)
- when (and
- (not (member fdir dirs))
- (cl-loop for g in globs thereis (funcall g f)))
- collect fdir into dirs
- finally (cl-return (delete-dups dirs))))
+ if (file-directory-p f)
+ append (eglot--directories-recursively f))))
;;; Rust-specific
- [elpa] externals/eglot 44504db1ea 28/33: Use `locate-user-emacs-file` instead of `concat`, (continued)
- [elpa] externals/eglot 44504db1ea 28/33: Use `locate-user-emacs-file` instead of `concat`, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 5cc8df63d8 08/33: Fix #702: Consider TRAMP in eglot-alternatives, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 0e6c0619da 09/33: Fix #703: Don't call eglot--executable-find more than needed, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot c17bdf6c98 16/33: Fixup last commit, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 8b15bf726f 19/33: Test javascript-basic with typescript-language-server, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 44793b6e07 20/33: Fix issues #755, #401; severity not set in textDocument/publishDiagnostics, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot b197e092f9 33/33: ; Fix typos, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 91b3f60d67 31/33: Add yaml-language-server for yaml-mode, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 04d2d6f783 02/33: Fix #649: two typos, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot e498cb171b 07/33: Per #697: Use project-files to know which directory watchers to skip, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 25d20c73cf 05/33: Fix #697, #645: Again speed up directory watching,
Stefan Kangas <=
- [elpa] externals/eglot cbb1da42be 12/33: Let eglot-flymake-backend be in flymake-d-functions even if Eglot off, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot a697084d8d 13/33: Fix #719: fall back to prompting user if eglot-alternatives fails, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 1612289ae4 18/33: Fix eglot--tramp-test-2 so it skips without clangd, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 9665359bb6 17/33: Fix workspace/configuration handling when given scopeUri directory, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 7b1055a188 21/33: Merge commit '8b15bf726faa2d753933a212c3426a63cabab21c', Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 55c13a9137 22/33: Merge pull request #759 from stephe-ada-guru/master, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 35994ca8cb 27/33: ; Prefer HTTPS to HTTP addresses, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 358104a5f0 29/33: Mention support for F# in README, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 761901bd55 30/33: Per #662, add a note to the README about updating TRAMP to 2.5.0.4+, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 2410637c17 32/33: Use fortls also for fortran-mode, Stefan Kangas, 2022/01/08