From 0d5d721da9fd0943b202b256bb6083c9eb213064 Mon Sep 17 00:00:00 2001 From: finga Date: Thu, 12 Sep 2024 10:36:33 +0200 Subject: [PATCH 1/3] lsp-mode: Add inline hints Add config to show some inline hints. --- .emacs.d/config/dev.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.emacs.d/config/dev.el b/.emacs.d/config/dev.el index deba04a..729f623 100644 --- a/.emacs.d/config/dev.el +++ b/.emacs.d/config/dev.el @@ -51,4 +51,7 @@ :hook (python-mode . lsp-deferred) (rust-mode . lsp-deferred) - (toml-mode . lsp-deferred)) + (toml-mode . lsp-deferred) + :config + (lsp-inlay-hints-mode) + (setq lsp-inlay-hint-enable t)) From d188dd4c89c189bfa7bc25851eb0c34bd643baaf Mon Sep 17 00:00:00 2001 From: finga Date: Thu, 12 Sep 2024 10:39:37 +0200 Subject: [PATCH 2/3] lsp-mode: Move python-mode config for lsp-mode to python config To decouple python from the dev config and contain it solely in the python config, configure the lsp-mode for python in the python config. --- .emacs.d/config/dev.el | 1 - .emacs.d/config/python.el | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.emacs.d/config/dev.el b/.emacs.d/config/dev.el index 729f623..2fc351f 100644 --- a/.emacs.d/config/dev.el +++ b/.emacs.d/config/dev.el @@ -49,7 +49,6 @@ (use-package lsp-mode :ensure t :hook - (python-mode . lsp-deferred) (rust-mode . lsp-deferred) (toml-mode . lsp-deferred) :config diff --git a/.emacs.d/config/python.el b/.emacs.d/config/python.el index ebd3269..e2236e9 100644 --- a/.emacs.d/config/python.el +++ b/.emacs.d/config/python.el @@ -5,3 +5,8 @@ :ensure t :hook (python-mode . flycheck-mode)) + +(use-package lsp-mode + :ensure t + :hook + (python-mode . lsp-deferred)) From ce1a0626067235b5dc6ee63801b127da52b2ef00 Mon Sep 17 00:00:00 2001 From: finga Date: Thu, 12 Sep 2024 10:43:19 +0200 Subject: [PATCH 3/3] lsp-mode: Move rust-mode config for lsp-mode to rust config To decouple rust from the dev config and contain it solely in the rust config, configure the lsp-mode for rust in the rust config. --- .emacs.d/config/dev.el | 3 --- .emacs.d/config/rust.el | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.emacs.d/config/dev.el b/.emacs.d/config/dev.el index 2fc351f..43fa99b 100644 --- a/.emacs.d/config/dev.el +++ b/.emacs.d/config/dev.el @@ -48,9 +48,6 @@ (use-package lsp-mode :ensure t - :hook - (rust-mode . lsp-deferred) - (toml-mode . lsp-deferred) :config (lsp-inlay-hints-mode) (setq lsp-inlay-hint-enable t)) diff --git a/.emacs.d/config/rust.el b/.emacs.d/config/rust.el index 87f9481..29368f7 100644 --- a/.emacs.d/config/rust.el +++ b/.emacs.d/config/rust.el @@ -10,5 +10,11 @@ ;; format code when saving (setq rust-format-on-save t)) +(use-package lsp-mode + :ensure t + :hook + (rust-mode . lsp-deferred) + (toml-mode . lsp-deferred)) + (use-package flycheck-rust :ensure t) (use-package toml-mode :ensure t)