[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/eglot2emacs 349f6b5f78 050/120: Don't advertise didchangewatched
From: |
João Távora |
Subject: |
feature/eglot2emacs 349f6b5f78 050/120: Don't advertise didchangewatchedfiles on tramp |
Date: |
Thu, 20 Oct 2022 07:16:52 -0400 (EDT) |
branch: feature/eglot2emacs
commit 349f6b5f7894667b5acb5a6a3dd93bcf27751c75
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Don't advertise didchangewatchedfiles on tramp
* eglot.el (eglot--trampish-p): New helper.
(eglot-client-capabilities): Use it.
(eglot--uri-to-path): Use it.
GitHub-reference: per https://github.com/joaotavora/eglot/issues/883
---
lisp/progmodes/eglot.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index cc0a06f4cb..ea9299ab59 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/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
;;;
- feature/eglot2emacs f8c8c70f8a 077/120: Reduce eldoc noise from hover messages, (continued)
- feature/eglot2emacs f8c8c70f8a 077/120: Reduce eldoc noise from hover messages, João Távora, 2022/10/20
- feature/eglot2emacs 9ffcd537f8 078/120: Apply any additionaltextedits unconditionally, João Távora, 2022/10/20
- feature/eglot2emacs b931d93b15 085/120: Guess the "lsp identifier at point", João Távora, 2022/10/20
- feature/eglot2emacs e5b021c01f 095/120: Fix jdtls support, João Távora, 2022/10/20
- feature/eglot2emacs a598352750 104/120: Allow eglot-workspace-configuration to be a plist, João Távora, 2022/10/20
- feature/eglot2emacs b633c29648 112/120: Rename "eglot -> eglot" in docstrings, João Távora, 2022/10/20
- feature/eglot2emacs 5b902b5cbb 110/120: Add support for "single server, multiple modes", João Távora, 2022/10/20
- feature/eglot2emacs 4071eaf8ad 116/120: * eglot.el (version): actually bump to 1.9, João Távora, 2022/10/20
- feature/eglot2emacs 9801e217f9 118/120: Rework header of eglot.el, João Távora, 2022/10/20
- feature/eglot2emacs 77f3157dcd 048/120: Use new jdtls script for eclipse jdt, João Távora, 2022/10/20
- feature/eglot2emacs 349f6b5f78 050/120: Don't advertise didchangewatchedfiles on tramp,
João Távora <=
- feature/eglot2emacs 965e1378f1 053/120: Use bounds of thing at point when asking for code actions, João Távora, 2022/10/20
- feature/eglot2emacs a38ce8b28f 052/120: Add simple support for workspacefolders, João Távora, 2022/10/20
- feature/eglot2emacs cb562118cb 047/120: Don't strip invisible text when formatting hover string, João Távora, 2022/10/20
- feature/eglot2emacs 904556f662 058/120: Easier initializationoptions in eglot-server-programs, João Távora, 2022/10/20
- feature/eglot2emacs 49e56e47d8 066/120: Solve flymake diagnostics synchronization problems, João Távora, 2022/10/20
- feature/eglot2emacs 917e8ffa31 080/120: Add support for jedi-language-server, João Távora, 2022/10/20
- feature/eglot2emacs 9dbc18cbfa 084/120: Tweak some details, fix some bugs, João Távora, 2022/10/20
- feature/eglot2emacs 2a12f622dc 087/120: Eglot-workspace-configuration can be a function, João Távora, 2022/10/20
- feature/eglot2emacs 1986c4df88 089/120: Reply more reasonably to server's workspace/applyedit, João Távora, 2022/10/20
- feature/eglot2emacs bef332a983 101/120: Adjust last commit about workspace configuration, João Távora, 2022/10/20