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

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

[elpa] externals/eglot f730fff 48/69: Merge branch 'master' into jsonrpc


From: João Távora
Subject: [elpa] externals/eglot f730fff 48/69: Merge branch 'master' into jsonrpc-refactor
Date: Fri, 22 Jun 2018 11:55:02 -0400 (EDT)

branch: externals/eglot
commit f730fff1d7164a33367fc4990f1b4f79cc8f7a9c
Merge: 2917214 935edcc
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Merge branch 'master' into jsonrpc-refactor
---
 eglot.el | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/eglot.el b/eglot.el
index 70d133b..60a0322 100644
--- a/eglot.el
+++ b/eglot.el
@@ -752,7 +752,7 @@ Uses THING, FACE, DEFS and PREPEND."
                                              (t          'eglot-note))
                                        message `((eglot-lsp-diag . 
,diag-spec)))))
          into diags
-         finally (cond (eglot--current-flymake-report-fn
+         finally (cond ((and flymake-mode eglot--current-flymake-report-fn)
                         (funcall eglot--current-flymake-report-fn diags)
                         (setq eglot--unreported-diagnostics nil))
                        (t
@@ -1303,6 +1303,18 @@ If SKIP-SIGNATURE, don't try to send 
textDocument/signatureHelp."
 
 ;;; Dynamic registration
 ;;;
+(defun eglot--wildcard-to-regexp (wildcard)
+  "(Very lame attempt to) convert WILDCARD to a Elisp regexp."
+  (cl-loop
+   with substs = '(("{" . "\\\\(")
+                   ("}" . "\\\\)")
+                   ("," . "\\\\|"))
+   with string = (wildcard-to-regexp wildcard)
+   for (pattern . rep) in substs
+   for target = string then result
+   for result = (replace-regexp-in-string pattern rep target)
+   finally return result))
+
 (cl-defun eglot--register-workspace/didChangeWatchedFiles (server &key id 
watchers)
   "Handle dynamic registration of workspace/didChangeWatchedFiles"
   (eglot--unregister-workspace/didChangeWatchedFiles server :id id)
@@ -1316,7 +1328,7 @@ If SKIP-SIGNATURE, don't try to send 
textDocument/signatureHelp."
              ((and (memq action '(created changed deleted))
                    (cl-find file globs
                             :test (lambda (f glob)
-                                    (string-match (wildcard-to-regexp
+                                    (string-match (eglot--wildcard-to-regexp
                                                    (expand-file-name glob))
                                                   f))))
               (jsonrpc-notify



reply via email to

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