From a7135a8baab2f2abaa9ca314ef1e7006e0ad9b72 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sun, 2 Dec 2018 22:45:39 -0500 Subject: [PATCH] Make LSP servers use current directory if no project detected it's a but hacky, but oh well --- .emacs.d/init.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index d18f19f..5a4a700 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -471,6 +471,13 @@ (setq lsp-inhibit-message t lsp-eldoc-render-all nil) + ;; hack to make LSP servers use current directory if no project detected + (defun my-default-directory () + "Returns the current directory." + default-directory) + (advice-add #'lsp--suggest-project-root + :after-until #'my-default-directory) + (use-package company-lsp :ensure :config (push 'company-lsp company-backends)