From 0e1a737127cf73bc581c96e02d04804554d78c3b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 20 Feb 2020 18:19:59 -0500 Subject: [PATCH] Fix #2541: empty imenu list in rustic+rls buffers --- modules/lang/rust/config.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/lang/rust/config.el b/modules/lang/rust/config.el index 0fb0bcc5e..30f224fa4 100644 --- a/modules/lang/rust/config.el +++ b/modules/lang/rust/config.el @@ -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")))