tools/lsp: fix +lsp-prompt-if-no-project-a #1928
Don't prompt for blacklisted folders, and don't refuse to recognize $HOME (let the user decide whether to blacklist it or not).
This commit is contained in:
parent
3a74c81bf2
commit
bf8ee34c19
1 changed files with 7 additions and 5 deletions
|
@ -53,12 +53,14 @@ auto-killed (which is usually an expensive process)."
|
|||
lsp--cur-workspace))))
|
||||
|
||||
(defadvice! +lsp-prompt-if-no-project-a (root)
|
||||
"Prompt for the project root only if no project was found.
|
||||
Also refuses to recognize $HOME as a valid project root."
|
||||
"Prompt for the project root only if no project was found."
|
||||
:filter-return #'lsp--calculate-root
|
||||
(cond ((and root (not (file-equal-p root "~")))
|
||||
root)
|
||||
(lsp-auto-guess-root
|
||||
(cond ((not lsp-auto-guess-root) nil)
|
||||
((null root) nil)
|
||||
((not (cl-find-if (lambda (dir)
|
||||
(and (lsp--files-same-host dir root)
|
||||
(file-in-directory-p dir root)))
|
||||
(lsp-session-folders-blacklist (lsp-session))))
|
||||
(lsp--find-root-interactively (lsp-session)))))
|
||||
|
||||
(defadvice! +lsp-init-a (&optional arg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue