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

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

[elpa] externals/eglot b657b32 068/139: Use rootUri instead of rootPath


From: João Távora
Subject: [elpa] externals/eglot b657b32 068/139: Use rootUri instead of rootPath
Date: Mon, 14 May 2018 09:54:55 -0400 (EDT)

branch: externals/eglot
commit b657b328692c1315754aa2246b456469cdc77107
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Use rootUri instead of rootPath
    
    * eglot.el (eglot--connect)
    (eglot--current-buffer-VersionedTextDocumentIdentifier): Use
    eglot--uri.
    (eglot--uri): New function.
---
 eglot.el | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/eglot.el b/eglot.el
index b305ca3..8e39591 100644
--- a/eglot.el
+++ b/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))
 



reply via email to

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