From dbc0740a434483ce09d8aa562489231f63006f9a Mon Sep 17 00:00:00 2001 From: Janis Date: Sat, 21 Dec 2024 20:58:57 +0100 Subject: [PATCH] lsp stuff --- init.org | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/init.org b/init.org index 36ae6c5..48b51a5 100644 --- a/init.org +++ b/init.org @@ -1375,21 +1375,37 @@ LSP sets it's prefix key to =s-l= by default, which uses the Super key which I u ) :config (setq - lsp-idle-delay 0.6 + lsp-idle-delay 0.5 lsp-inlay-hint-enable t lsp-modeline-code-actions-enable t lsp-modeline-code-actions-segments '(name count) lsp-modeline-diagnostics-enable t - - lsp-glsl-executable '("glsl_analyzer") + lsp-completion-enable-additional-text-edit t lsp-rust-server 'rust-analyzer lsp-rust-analyzer-server-display-inlay-hints t lsp-rust-analyzer-proc-macro-enable t + lsp-rust-analyzer-completion-auto-import-enable t + lsp-rust-analyzer-proc-macro-enable t lsp-rust-analyzer-binding-mode-hints t lsp-rust-analyzer-display-closure-return-type-hints t lsp-rust-analyzer-server-format-inlay-hints t) + + (setq lsp-glsl-executable '("glsl_analyzer")) (add-to-list 'lsp-language-id-configuration '("CMakeLists.txt" . "cmake")) + ) + +(use-package consult-lsp + :straight t + :general + (with-eval-after-load 'lsp-mode + (general-define-key + :keymaps 'lsp-command-map + "c s" '("Symbols" . consult-lsp-symbols) + "c f" '("Symbols" . consult-lsp-file-symbols) + "c d" '("Diagnostics" . consult-lsp-diagnostics) + ) + ) ) (use-package lsp-treemacs @@ -1399,8 +1415,8 @@ LSP sets it's prefix key to =s-l= by default, which uses the Super key which I u (use-package lsp-ui :config (setq - ;;lsp-modeline-code-actions-enable nil - ;;lsp-rust-analyzer-cargo-all-targets nil + ;; lsp-modeline-code-actions-enable nil + ;; lsp-rust-analyzer-cargo-all-targets nil ;; lsp-rust-analyzer-server-command "xwin-env rust-analyzer" lsp-ui-sideline-show-code-actions t lsp-ui-doc-enable t @@ -1437,7 +1453,7 @@ hlsl-mode: #+begin_src emacs-lisp (use-package rust-mode :straight t - :hook (rust-mode . lsp-mode) + ;; :hook (rust-mode . lsp-mode) :init (setq rust-mode-treesitter-derive t )) @@ -1473,10 +1489,11 @@ hlsl-mode: :keymaps 'rustic-mode-map "m" '(:keymap nemo/rust-map :wk "Cargo") ) - :custom - (rustic-analyzer-command '("/usr/bin/rust-analyzer")) :config - (setq rustic-format-trigger 'on-save) + (setq rustic-format-on-save t + rustic-format-on-save-method #'rustic-format-buffer + rustic-analyzer-command '("/usr/bin/rust-analyzer") + ) ) #+end_src