tools/lsp: allow +lsp-prompt-to-install-server = 'quiet
This commit is contained in:
parent
3e32379f54
commit
7f6bcb8616
1 changed files with 7 additions and 3 deletions
|
@ -5,7 +5,10 @@
|
||||||
Can be a list of backends; accepts any value `company-backends' accepts.")
|
Can be a list of backends; accepts any value `company-backends' accepts.")
|
||||||
|
|
||||||
(defvar +lsp-prompt-to-install-server t
|
(defvar +lsp-prompt-to-install-server t
|
||||||
"If non-nil, prompt to install a server if no server is present.")
|
"If non-nil, prompt to install a server if no server is present.
|
||||||
|
|
||||||
|
If set to `quiet', suppress the install prompt and don't visibly inform the user
|
||||||
|
about it (it will be logged to *Messages* however).")
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -120,9 +123,10 @@ server getting expensively restarted when reverting buffers."
|
||||||
(if (or (lsp--filter-clients
|
(if (or (lsp--filter-clients
|
||||||
(-andfn #'lsp--matching-clients?
|
(-andfn #'lsp--matching-clients?
|
||||||
#'lsp--server-binary-present?))
|
#'lsp--server-binary-present?))
|
||||||
+lsp-prompt-to-install-server)
|
(not (memq +lsp-prompt-to-install-server '(nil quiet))))
|
||||||
(apply orig-fn args)
|
(apply orig-fn args)
|
||||||
(lsp--info "No language server available for %S" major-mode)))))
|
(let ((inhibit-message (not (eq +lsp-prompt-to-install-server 'quiet))))
|
||||||
|
(lsp--info "No language server available for %S" major-mode))))))
|
||||||
|
|
||||||
|
|
||||||
(use-package! lsp-ui
|
(use-package! lsp-ui
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue