emacs-diffs
[Top][All Lists]
Advanced

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

master d34fc7b7aa 2/2: Eglot: don't confuse URLs and windows file paths


From: João Távora
Subject: master d34fc7b7aa 2/2: Eglot: don't confuse URLs and windows file paths
Date: Thu, 24 Nov 2022 10:26:59 -0500 (EST)

branch: master
commit d34fc7b7aa9d2779ebbada5cecd8bd2806e3e01e
Author: dannyfreeman <danny@dfreeman.email>
Commit: João Távora <jatav@vestas.com>

    Eglot: don't confuse URLs and windows file paths
    
    bug#59338
    
    * lisp/progmodes/eglot.el (eglot--path-to-uri): Check for windows path
---
 lisp/progmodes/eglot.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index d05b5ee335..5f13679b1e 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1503,11 +1503,15 @@ If optional MARKER, return a marker instead"
 (defun eglot--path-to-uri (path)
   "URIfy PATH."
   (let ((truepath (file-truename path)))
-    (if (url-type (url-generic-parse-url truepath))
+    (if (and (url-type (url-generic-parse-url path))
+             ;; It might be MS Windows path which includes a drive
+             ;; letter that looks like a URL scheme (bug#59338)
+             (not (and (eq system-type 'windows-nt)
+                       (file-name-absolute-p truepath))))
         ;; Path is already a URI, so forward it to the LSP server
         ;; untouched.  The server should be able to handle it, since
         ;; it provided this URI to clients in the first place.
-        truepath
+        path
       (concat "file://"
               ;; Add a leading "/" for local MS Windows-style paths.
               (if (and (eq system-type 'windows-nt)



reply via email to

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