emacs-diffs
[Top][All Lists]
Advanced

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

master 7d53164162: Eglot: fix null scopeUri regression in workspace/conf


From: Ingo Lohmar
Subject: master 7d53164162: Eglot: fix null scopeUri regression in workspace/configuration
Date: Sun, 13 Nov 2022 11:48:48 -0500 (EST)

branch: master
commit 7d53164162b3e36b53f52f4132cea3202919f749
Author: Ingo Lohmar <ingo.lohmar@posteo.net>
Commit: Ingo Lohmar <ingo.lohmar@posteo.net>

    Eglot: fix null scopeUri regression in workspace/configuration
    
    * lisp/progmodes/eglot.el (eglot-handle-request):
    Commit 1a2d603bb3938ff68ed1a5412d131b41efd40a24 changed
    `eglot--uri-to-path' to return a nil uri untouched.  (Before,
    `url-unhex-string' turned the parsed all-nil uri record into the empty
    string.)
    
    A nil return value must now be handled in the caller, do that for the
    workspace/configuration handler to avoid an uncaught error.
---
 lisp/progmodes/eglot.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 98d5281d2c..12808e80c4 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2368,10 +2368,11 @@ When called interactively, use the currently active 
server"
             (with-temp-buffer
               (let* ((uri-path (eglot--uri-to-path scopeUri))
                      (default-directory
-                       (if (and (not (string-empty-p uri-path))
-                                (file-directory-p uri-path))
-                           (file-name-as-directory uri-path)
-                         (project-root (eglot--project server)))))
+                      (if (and uri-path
+                               (not (string-empty-p uri-path))
+                               (file-directory-p uri-path))
+                          (file-name-as-directory uri-path)
+                        (project-root (eglot--project server)))))
                 (setq-local major-mode (car (eglot--major-modes server)))
                 (hack-dir-local-variables-non-file-buffer)
                 (cl-loop for (wsection o)



reply via email to

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