Make LSP servers use current directory if no project detected

it's a but hacky, but oh well
This commit is contained in:
Adam Goldsmith 2018-12-02 22:45:39 -05:00
parent 739385b48b
commit a7135a8baa
1 changed files with 7 additions and 0 deletions

View File

@ -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)