tools/lsp: prompt for project if one can't be guessed #1928
And don't recognize $HOME as a valid project root.
This commit is contained in:
parent
0cca037448
commit
8dfc4b3033
1 changed files with 9 additions and 0 deletions
|
@ -20,6 +20,15 @@ This can be a single company backend or a list thereof. It can be anything
|
||||||
:definition 'lsp-find-definition
|
:definition 'lsp-find-definition
|
||||||
:references 'lsp-find-references)
|
:references 'lsp-find-references)
|
||||||
|
|
||||||
|
(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."
|
||||||
|
:filter-return #'lsp--calculate-root
|
||||||
|
(cond ((and root (not (file-equal-p root "~")))
|
||||||
|
root)
|
||||||
|
(lsp-auto-guess-root
|
||||||
|
(lsp--find-root-interactively (lsp-session)))))
|
||||||
|
|
||||||
(defadvice! +lsp-init-a (&optional arg)
|
(defadvice! +lsp-init-a (&optional arg)
|
||||||
"Enable `lsp-mode' in the current buffer.
|
"Enable `lsp-mode' in the current buffer.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue