aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-12 00:40:22 -0500
committerCraig Jennings <c@cjennings.net>2026-05-12 00:40:22 -0500
commitb45638194cc19b026c49e0cb4787024c73723954 (patch)
tree777c56061b36369ee7c887f2b8bc1168049f69fb
parent203560396ea67bac7a7375cd2fbfa99433b672a9 (diff)
downloaddotemacs-b45638194cc19b026c49e0cb4787024c73723954.tar.gz
dotemacs-b45638194cc19b026c49e0cb4787024c73723954.zip
refactor(lsp): rename cj/lsp--disable-eldoc-hover for accuracy
The helper removes lsp-mode's entry from `eldoc-documentation-functions' in the current buffer. It never touched hover display, so the old name was misleading. It's now `cj/lsp--remove-eldoc-provider', the two tests rename to match, and the docstring drops the "hover" wording.
-rw-r--r--modules/prog-lsp.el7
-rw-r--r--tests/test-prog-lsp--add-file-watch-ignored-extras.el10
2 files changed, 9 insertions, 8 deletions
diff --git a/modules/prog-lsp.el b/modules/prog-lsp.el
index 8e889678..e03a475d 100644
--- a/modules/prog-lsp.el
+++ b/modules/prog-lsp.el
@@ -48,8 +48,9 @@ Idempotent — `add-to-list' skips patterns already present."
(dolist (pattern cj/lsp-file-watch-ignored-extras)
(add-to-list 'lsp-file-watch-ignored-directories pattern)))
-(defun cj/lsp--disable-eldoc-hover ()
- "Remove lsp-mode's Eldoc hover provider in the current buffer."
+(defun cj/lsp--remove-eldoc-provider ()
+ "Remove lsp-mode's provider from `eldoc-documentation-functions' here.
+Buffer-local — the global hook value is untouched."
(remove-hook 'eldoc-documentation-functions #'lsp-eldoc-function t))
;;;;; ---------------------------- LSP Mode ---------------------------
@@ -72,7 +73,7 @@ Idempotent — `add-to-list' skips patterns already present."
(setq lsp-enable-on-type-formatting nil)
(setq lsp-signature-auto-activate nil)
(setq lsp-signature-render-documentation nil)
- (add-hook 'lsp-managed-mode-hook #'cj/lsp--disable-eldoc-hover)
+ (add-hook 'lsp-managed-mode-hook #'cj/lsp--remove-eldoc-provider)
(setq lsp-modeline-code-actions-enable nil)
(setq lsp-modeline-diagnostics-enable nil)
(setq lsp-headerline-breadcrumb-enable nil)
diff --git a/tests/test-prog-lsp--add-file-watch-ignored-extras.el b/tests/test-prog-lsp--add-file-watch-ignored-extras.el
index 6213b58c..142cd2ea 100644
--- a/tests/test-prog-lsp--add-file-watch-ignored-extras.el
+++ b/tests/test-prog-lsp--add-file-watch-ignored-extras.el
@@ -87,21 +87,21 @@
(should-error (cj/lsp--add-file-watch-ignored-extras)
:type 'wrong-type-argument)))
-(ert-deftest test-prog-lsp--disable-eldoc-hover-removes-lsp-provider-locally ()
+(ert-deftest test-prog-lsp--remove-eldoc-provider-removes-lsp-provider-locally ()
"Normal: remove lsp-mode's Eldoc provider from the buffer-local hook."
(with-temp-buffer
(setq-local eldoc-documentation-functions
'(lsp-eldoc-function eldoc-documentation-default))
- (cj/lsp--disable-eldoc-hover)
+ (cj/lsp--remove-eldoc-provider)
(should-not (memq #'lsp-eldoc-function eldoc-documentation-functions))
(should (memq 'eldoc-documentation-default eldoc-documentation-functions))))
-(ert-deftest test-prog-lsp--disable-eldoc-hover-does-not-touch-default-value ()
- "Boundary: disabling LSP Eldoc in one buffer leaves the default hook alone."
+(ert-deftest test-prog-lsp--remove-eldoc-provider-does-not-touch-default-value ()
+ "Boundary: removing the LSP provider in one buffer leaves the default hook alone."
(let ((eldoc-documentation-functions '(lsp-eldoc-function)))
(with-temp-buffer
(setq-local eldoc-documentation-functions '(lsp-eldoc-function))
- (cj/lsp--disable-eldoc-hover)
+ (cj/lsp--remove-eldoc-provider)
(should-not (memq #'lsp-eldoc-function eldoc-documentation-functions)))
(should (memq #'lsp-eldoc-function eldoc-documentation-functions))))