Fix #2541: empty imenu list in rustic+rls buffers

This commit is contained in:
Henrik Lissner 2020-02-20 18:19:59 -05:00
parent cd3103b1be
commit 0e1a737127
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -48,10 +48,19 @@
:desc "all" "a" #'rustic-cargo-test
:desc "current test" "t" #'rustic-cargo-current-test))
;; HACK Fixes #2541: RLS doesn't appear to support documentSymbol, but
;; lsp-rust thinks it does, and so yields imenu population to the server.
;; The result is an empty imenu list. Until RLS supports documentSymbol,
;; we disable `lsp-enable-imenu' is rust+RLS buffers.
(defadvice! +rust--disable-imenu-for-lsp-mode-a (&rest _)
:before #'rustic-lsp-mode-setup
(when (eq rustic-lsp-server 'rls)
(setq-local lsp-enable-imenu nil)))
;; If lsp/elgot isn't available, it attempts to install lsp-mode via
;; package.el. Doom manages its own dependencies through straight so disable
;; this behavior to avoid package-not-initialized errors.
(defadvice! +rust--dont-install-packages-p (&rest _)
(defadvice! +rust--dont-install-packages-a (&rest _)
:override #'rustic-install-lsp-client-p
(message "No LSP server running")))