diff --git a/eglot.el b/eglot.el index 4416e52c..73864c98 100644 --- a/eglot.el +++ b/eglot.el @@ -840,8 +840,10 @@ This docstring appeases checkdoc, that's all." (lambda () (setf (eglot--inhibit-autoreconnect server) (null eglot-autoreconnect))))))) - (run-hook-with-args 'eglot-connect-hook server) - (run-hook-with-args 'eglot-server-initialized-hook server) + (let ((default-directory (car (project-roots project)))) + (hack-dir-local-variables-non-file-buffer) + (run-hook-with-args 'eglot-connect-hook server) + (run-hook-with-args 'eglot-server-initialized-hook server)) (eglot--message "Connected! Server `%s' now managing `%s' buffers \ in project `%s'."