(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
"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)
(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))))
+
\f
;;; Minor modes
;;;