]> git.eshelyaron.com Git - emacs.git/commitdiff
; * lisp/progmodes/eglot.el (eglot-path-to-uri): Add comment.
authorEli Zaretskii <eliz@gnu.org>
Sat, 20 Apr 2024 07:32:34 +0000 (10:32 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 20 Apr 2024 11:11:10 +0000 (14:11 +0300)
(cherry picked from commit 4d5fac4002412567b2b587c3cc4a1535ace0f2a8)

lisp/progmodes/eglot.el

index d023ea241344d3f3f14513452847dcd180e55e99..61c388214fbda07690dd9436f5689d647a80fee2 100644 (file)
@@ -1090,13 +1090,15 @@ ACTION is an LSP object of either `CodeAction' or `Command' type."
 
 (defun eglot-path-to-uri (path)
   "Convert PATH, a file name, to LSP URI string and return it."
+  ;; Some LSP servers don't resolve symlinks, so we must do that
+  ;; for them by calling 'file-truename below'.
   (let ((truepath (file-truename path)))
     (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)
+             ;; PATH might be MS Windows file name 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
+        ;; 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.
         path