]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix workspace/configuration handling when given scopeuri directory
authorIngo Lohmar <ingo.lohmar@posteo.net>
Sat, 9 Oct 2021 19:19:37 +0000 (21:19 +0200)
committerIngo Lohmar <ingo.lohmar@posteo.net>
Sat, 9 Oct 2021 19:31:17 +0000 (21:31 +0200)
The path returned by eglot--uri-to-path is mostly used for file paths,
and therefore does not end with a slash.  Such a no-trailing-slash path
violates what default-directory demands (per its docstring), which
causes hack-dir-local-variables-non-file-buffer to not find the
appropriate dir-local vars.

lisp/progmodes/eglot.el

index 7ebc422451918ac34501c0388b3d14480f635282..bf9cf25c33ba3b0beda6b3701bb29a0526600b53 100644 (file)
@@ -2007,7 +2007,7 @@ When called interactively, use the currently active server"
                      (default-directory
                        (if (and (not (string-empty-p uri-path))
                                 (file-directory-p uri-path))
-                           uri-path
+                           (file-name-as-directory uri-path)
                          (project-root (eglot--project server)))))
                 (setq-local major-mode (eglot--major-mode server))
                 (hack-dir-local-variables-non-file-buffer)