From c0b74d0b5938583db829363ebafdd9e0701554a4 Mon Sep 17 00:00:00 2001 From: Ingo Lohmar Date: Sat, 9 Oct 2021 21:19:37 +0200 Subject: [PATCH] Fix workspace/configuration handling when given scopeuri directory 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 7ebc4224519..bf9cf25c33b 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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) -- 2.39.5