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

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

[elpa] externals/eglot d5c7c40bc2: Per #883: Don't advertise didChangeWa


From: ELPA Syncer
Subject: [elpa] externals/eglot d5c7c40bc2: Per #883: Don't advertise didChangeWatchedFiles on Tramp
Date: Tue, 15 Mar 2022 06:57:35 -0400 (EDT)

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

    Per #883: Don't advertise didChangeWatchedFiles on Tramp
    
    * eglot.el (eglot--trampish-p): New helper.
    (eglot-client-capabilities): Use it.
    (eglot--uri-to-path): Use it.
---
 eglot.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eglot.el b/eglot.el
index cc0a06f4cb..ea9299ab59 100644
--- a/eglot.el
+++ b/eglot.el
@@ -644,13 +644,15 @@ treated as in `eglot-dbind'."
 
 (cl-defgeneric eglot-client-capabilities (server)
   "What the EGLOT LSP client supports for SERVER."
-  (:method (_s)
+  (:method (s)
            (list
             :workspace (list
                         :applyEdit t
                         :executeCommand `(:dynamicRegistration :json-false)
                         :workspaceEdit `(:documentChanges t)
-                        :didChangeWatchedFiles `(:dynamicRegistration t)
+                        :didChangeWatchedFiles
+                        `(:dynamicRegistration
+                          ,(if (eglot--trampish-p s) :json-false t))
                         :symbol `(:dynamicRegistration :json-false)
                         :configuration t)
             :textDocument
@@ -1401,9 +1403,7 @@ If optional MARKER, return a marker instead"
   "Convert URI to file path, helped by `eglot--current-server'."
   (when (keywordp uri) (setq uri (substring (symbol-name uri) 1)))
   (let* ((server (eglot-current-server))
-         (remote-prefix (and server
-                             (file-remote-p
-                              (project-root (eglot--project server)))))
+         (remote-prefix (and server (eglot--trampish-p server)))
          (retval (url-filename (url-generic-parse-url (url-unhex-string uri))))
          ;; Remove the leading "/" for local MS Windows-style paths.
          (normalized (if (and (not remote-prefix)
@@ -1518,6 +1518,10 @@ and just return it.  PROMPT shouldn't end with a 
question mark."
              (cl-find read servers :key name :test #'equal)))
           (t (car servers)))))
 
+(defun eglot--trampish-p (server)
+  "Tell if SERVER's project root is `file-remote-p'."
+  (file-remote-p (project-root (eglot--project server))))
+
 
 ;;; Minor modes
 ;;;



reply via email to

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