Disable lsp-auto-guess-root
This was too confusing for beginners. May as well have LSP prompt or a project than sometimes guess incorrectly. Closes #3212, #3075
This commit is contained in:
parent
f47ec8b919
commit
8c3f24f14c
1 changed files with 0 additions and 15 deletions
|
@ -15,9 +15,6 @@ working on that project after closing the last buffer.")
|
||||||
:commands lsp-install-server
|
:commands lsp-install-server
|
||||||
:init
|
:init
|
||||||
(setq lsp-session-file (concat doom-etc-dir "lsp-session"))
|
(setq lsp-session-file (concat doom-etc-dir "lsp-session"))
|
||||||
;; Don't prompt the user for the project root every time we open a new
|
|
||||||
;; lsp-worthy file, instead, try to guess it with projectile.
|
|
||||||
(setq lsp-auto-guess-root t)
|
|
||||||
;; Auto-kill LSP server after last workspace buffer is killed.
|
;; Auto-kill LSP server after last workspace buffer is killed.
|
||||||
(setq lsp-keep-workspace-alive nil)
|
(setq lsp-keep-workspace-alive nil)
|
||||||
;; Let `flycheck-check-syntax-automatically' determine this.
|
;; Let `flycheck-check-syntax-automatically' determine this.
|
||||||
|
@ -162,18 +159,6 @@ auto-killed (which is a potentially expensive process)."
|
||||||
(funcall orig-fn))))
|
(funcall orig-fn))))
|
||||||
lsp--cur-workspace))))
|
lsp--cur-workspace))))
|
||||||
|
|
||||||
(defadvice! +lsp-prompt-if-no-project-a (session file-name)
|
|
||||||
"Prompt for the project root only if no project was found."
|
|
||||||
:after-until #'lsp--calculate-root
|
|
||||||
(cond ((not lsp-auto-guess-root)
|
|
||||||
nil)
|
|
||||||
((cl-find-if (lambda (dir)
|
|
||||||
(and (lsp--files-same-host dir file-name)
|
|
||||||
(file-in-directory-p file-name dir)))
|
|
||||||
(lsp-session-folders-blacklist session))
|
|
||||||
nil)
|
|
||||||
((lsp--find-root-interactively session))))
|
|
||||||
|
|
||||||
;; Don't prompt to restart LSP servers while quitting Emacs
|
;; Don't prompt to restart LSP servers while quitting Emacs
|
||||||
(add-hook! 'kill-emacs-hook (setq lsp-restart 'ignore)))
|
(add-hook! 'kill-emacs-hook (setq lsp-restart 'ignore)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue