[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elpa b34447c 45/71: Close #473: simplify eglot-code-act
From: |
João Távora |
Subject: |
[elpa] externals/elpa b34447c 45/71: Close #473: simplify eglot-code-actions |
Date: |
Wed, 16 Dec 2020 11:42:23 -0500 (EST) |
branch: externals/elpa
commit b34447c6698837186552e4bab6b1a422b45e42dd
Author: muffinmad <andreyk.mad@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Close #473: simplify eglot-code-actions
If no region is active, ask for code actions at point, even if there
are no diagnostics at point.
Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el (eglot-code-actions): Simplify.
---
eglot.el | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/eglot.el b/eglot.el
index 8bb610b..4b25368 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2563,15 +2563,13 @@ documentation. Honour `eglot-put-doc-in-help-buffer',
current-prefix-arg))
-(defun eglot-code-actions (&optional beg end)
- "Get and offer to execute code actions between BEG and END."
+(defun eglot-code-actions (beg &optional end)
+ "Offer to execute code actions between BEG and END.
+Interactively, if a region is active, BEG and END are its bounds,
+else BEG is point and END is nil, which results in a request for
+code actions at point"
(interactive
- (let (diags)
- (cond ((region-active-p) (list (region-beginning) (region-end)))
- ((setq diags (flymake-diagnostics (point)))
- (list (cl-reduce #'min (mapcar #'flymake-diagnostic-beg diags))
- (cl-reduce #'max (mapcar #'flymake-diagnostic-end diags))))
- (t (list (point-min) (point-max))))))
+ (if (region-active-p) `(,(region-beginning) ,(region-end)) `(,(point) nil)))
(unless (eglot--server-capable :codeActionProvider)
(eglot--error "Server can't execute code actions!"))
(let* ((server (eglot--current-server-or-lose))
- [elpa] externals/elpa bb51d47 30/71: Close #409: make a test more robust, (continued)
- [elpa] externals/elpa bb51d47 30/71: Close #409: make a test more robust, João Távora, 2020/12/16
- [elpa] externals/elpa 1cfcef4 37/71: Close #471: add support for erlang_ls, João Távora, 2020/12/16
- [elpa] externals/elpa da7ff48 31/71: Fix #468: don't call flymake report function if flymake is disabled, João Távora, 2020/12/16
- [elpa] externals/elpa e514f9e 29/71: Close #461: make CI fail if byte compiler warns, João Távora, 2020/12/16
- [elpa] externals/elpa ffe79b9 34/71: Pin pyls to 0.31.10, João Távora, 2020/12/16
- [elpa] externals/elpa b0bfbfb 38/71: Fix #488: fix type error in eglot--xref-make-match, João Távora, 2020/12/16
- [elpa] externals/elpa 3634402 36/71: Fix #479: correctly place diagnostics in narrowed buffers, João Távora, 2020/12/16
- [elpa] externals/elpa e7a43e2 40/71: Fix #480: also consider label of a CompletionItem for snippets, João Távora, 2020/12/16
- [elpa] externals/elpa a807b4f 43/71: Some test-related cleanup, João Távora, 2020/12/16
- [elpa] externals/elpa 9874456 42/71: Close #482: use filter-buffer-substring to get buffer text, João Távora, 2020/12/16
- [elpa] externals/elpa b34447c 45/71: Close #473: simplify eglot-code-actions,
João Távora <=
- [elpa] externals/elpa a044dec 47/71: Delegate "hover" and "signature" doc synchronization efforts to Eldoc, João Távora, 2020/12/16
- [elpa] externals/elpa a04b826 48/71: Update tests after update to newer Eldoc, João Távora, 2020/12/16
- [elpa] externals/elpa 2b7ec0e 51/71: Expect eglot-multiline-eldoc to fail on Travis, João Távora, 2020/12/16
- [elpa] externals/elpa 6d96601 52/71: Closes #509: fix sorting of completion items, João Távora, 2020/12/16
- [elpa] externals/elpa 4e82f53 53/71: Reload Eldoc if needed on Emacs < 28, João Távora, 2020/12/16
- [elpa] externals/elpa 8c9219d 55/71: Unbreak tests after changes to eldoc.el, João Távora, 2020/12/16
- [elpa] externals/elpa ea82b4b 57/71: Close #505: ensure completion terminates in correct buffer, João Távora, 2020/12/16
- [elpa] externals/elpa fb6b17e 58/71: New 'make interactive' target for debuggable M-x ert, João Távora, 2020/12/16
- [elpa] externals/elpa 5f873d2 60/71: Fix #521: Correct paren mismatch blunder introduced by earlier commit, João Távora, 2020/12/16
- [elpa] externals/elpa 209b227 61/71: Fix #524: provide suitable default to M-x eglot-rename, João Távora, 2020/12/16