[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 6a7ce66 32/69: Expand directory watcher globs con
From: |
João Távora |
Subject: |
[elpa] externals/eglot 6a7ce66 32/69: Expand directory watcher globs containing ** (#293) |
Date: |
Sun, 20 Oct 2019 08:21:47 -0400 (EDT) |
branch: externals/eglot
commit 6a7ce6634fcf79853a6bd89cf1c81bad2ac25540
Author: Jürgen Hötzel <address@hidden>
Commit: João Távora <address@hidden>
Expand directory watcher globs containing ** (#293)
Previously, if the server requested a glob pattern like foo/**/*
to be watched, we would just error. Now we watch foo/bar/ and
foo/baz/ as if the server had requested those two watchers
instead of just the one with the **.
As a limitation, the implementation of file-expand-wildcards
doesn't fully handle ** globstars (** matches at most one path
segment).
* eglot.el (eglot-register-capability workspace/didChangeWatchedFiles):
Use file-expand-wildcards to make a ** glob into multiple **-less
globs.
---
eglot.el | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/eglot.el b/eglot.el
index a80be22..6078e97 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2371,7 +2371,10 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
(let* (success
(globs (mapcar (eglot--lambda ((FileSystemWatcher) globPattern)
globPattern)
- watchers)))
+ watchers))
+ (glob-dirs
+ (delete-dups (mapcar #'file-name-directory
+ (mapcan #'file-expand-wildcards globs)))))
(cl-labels
((handle-event
(event)
@@ -2394,13 +2397,14 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
(handle-event '(desc 'deleted file))
(handle-event '(desc 'created file1)))))))
(unwind-protect
- (progn (dolist (dir (delete-dups (mapcar #'file-name-directory
globs)))
- (push (file-notify-add-watch dir '(change) #'handle-event)
- (gethash id (eglot--file-watches server))))
- (setq
- success
- `(:message ,(format "OK, watching %s watchers"
- (length watchers)))))
+ (progn
+ (dolist (dir glob-dirs)
+ (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"
+ (length glob-dirs) (length watchers)))))
(unless success
(eglot-unregister-capability server method id))))))
- [elpa] externals/eglot cf161b0 41/69: Test with emacs master on Travis, (continued)
- [elpa] externals/eglot cf161b0 41/69: Test with emacs master on Travis, João Távora, 2019/10/20
- [elpa] externals/eglot 9e70cd2 40/69: * eglot-tests.el (python-autopep-formatting): Attempt to fix test., João Távora, 2019/10/20
- [elpa] externals/eglot c3bae0a 44/69: New test for the eglot-autoshutdown defcustom, João Távora, 2019/10/20
- [elpa] externals/eglot 28d8ffe 48/69: Fix #285: unbreak Elm language server which does use :triggerCharacters, João Távora, 2019/10/20
- [elpa] externals/eglot 06ff65d 52/69: Rework and correct major part of xref glue code, João Távora, 2019/10/20
- [elpa] externals/eglot 9951dc5 62/69: Add a test for vscode-json-languageserver's completions, João Távora, 2019/10/20
- [elpa] externals/eglot 124a833 56/69: Add a test for #311 and #279, João Távora, 2019/10/20
- [elpa] externals/eglot d774754 37/69: Merge pull request #298 from jorams/nil-capabilities-as-false, João Távora, 2019/10/20
- [elpa] externals/eglot 20195e5 42/69: On buffer kill, first send didClose then teardown local structures, João Távora, 2019/10/20
- [elpa] externals/eglot 5a98c5a 55/69: Fix eglot-completion-at-point to work with bare completion-at-point, João Távora, 2019/10/20
- [elpa] externals/eglot 6a7ce66 32/69: Expand directory watcher globs containing ** (#293),
João Távora <=
- [elpa] externals/eglot f45fdc6 31/69: Fix invalid guess for php language Server (#288), João Távora, 2019/10/20
- [elpa] externals/eglot 05c68c2 45/69: Don't send dummy JSON object in "initialized" notification (#312), João Távora, 2019/10/20
- [elpa] externals/eglot bff921e 60/69: Per #319: always filter completions client-side by prefix, João Távora, 2019/10/20
- [elpa] externals/eglot 260f152 65/69: Fix #321: don't choke on single-location reply to tD/definition, João Távora, 2019/10/20
- [elpa] externals/eglot 8a17c29 61/69: Close #235: play along with LSP's filterText hacks, João Távora, 2019/10/20
- [elpa] externals/eglot f5151be 67/69: Don't immediately request completions in eglot-completion-at-point, João Távora, 2019/10/20
- [elpa] externals/eglot 74240c7 66/69: Protect against zero-length completions, João Távora, 2019/10/20