]> git.eshelyaron.com Git - emacs.git/commitdiff
Use rooturi instead of rootpath
authorJoão Távora <joaotavora@gmail.com>
Fri, 4 May 2018 13:29:40 +0000 (14:29 +0100)
committerJoão Távora <joaotavora@gmail.com>
Fri, 4 May 2018 13:29:40 +0000 (14:29 +0100)
* eglot.el (eglot--connect)
(eglot--current-buffer-VersionedTextDocumentIdentifier): Use
eglot--uri.
(eglot--uri): New function.

lisp/progmodes/eglot.el

index b305ca303c3e89b017573d10ee263bc1fc889958..8e39591a70d91ff4f8e7ca9fdd09161acff30992 100644 (file)
@@ -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))
+
 \f
 ;;; 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))