From 42733a1e9fd0501217857f98560ddbbe461aa0d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 4 May 2018 14:29:40 +0100 Subject: [PATCH] Use rooturi instead of rootpath * eglot.el (eglot--connect) (eglot--current-buffer-VersionedTextDocumentIdentifier): Use eglot--uri. (eglot--uri): New function. --- lisp/progmodes/eglot.el | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index b305ca303c3..8e39591a70d 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -221,9 +221,9 @@ SUCCESS-FN with no args if all goes well." proc :initialize (eglot--obj :processId (emacs-pid) - :rootPath (concat - (expand-file-name (car (project-roots - (project-current))))) + :rootUri (eglot--uri + (expand-file-name (car (project-roots + (project-current))))) :initializationOptions [] :capabilities (eglot--client-capabilities)) :success-fn @@ -666,6 +666,8 @@ identifier. ERROR is non-nil if this is a JSON-RPC error." (apply #'format format args) :warning))) +(defun eglot--uri (path) "Add file:// to PATH." (concat "file://" path)) + ;;; Minor modes ;;; @@ -988,10 +990,10 @@ running. INTERACTIVE is t if called interactively." (defun eglot--current-buffer-VersionedTextDocumentIdentifier () "Compute VersionedTextDocumentIdentifier object for current buffer." (eglot--obj :uri - (concat "file://" - (url-hexify-string - (file-truename buffer-file-name) - url-path-allowed-chars)) + (eglot--uri + (url-hexify-string + (file-truename buffer-file-name) + url-path-allowed-chars)) ;; FIXME: later deal with workspaces :version eglot--versioned-identifier)) -- 2.39.2