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.
(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)