[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 8e1a91b 31/62: Add a generic eglot-execute-comman
From: |
Stefan Monnier |
Subject: |
[elpa] externals/eglot 8e1a91b 31/62: Add a generic eglot-execute-command API |
Date: |
Sat, 29 Sep 2018 17:13:32 -0400 (EDT) |
branch: externals/eglot
commit 8e1a91b1bb0e7c932d3bbe84c0b742019ea5b7b0
Author: Michał K <address@hidden>
Commit: João Távora <address@hidden>
Add a generic eglot-execute-command API
* eglot.el (eglot-execute-command): New defgeneric and method. Use it
to request :workspace/executeCommand.
(eglot-code-actions): Use it.
---
eglot.el | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/eglot.el b/eglot.el
index 9e16d43..e250ce0 100644
--- a/eglot.el
+++ b/eglot.el
@@ -158,6 +158,9 @@ lasted more than that many seconds."
(cl-defgeneric eglot-handle-notification (server method id &rest params)
"Handle SERVER's METHOD notification with PARAMS.")
+(cl-defgeneric eglot-execute-command (server command arguments)
+ "Execute on SERVER COMMAND with ARGUMENTS.")
+
(cl-defgeneric eglot-initialization-options (server)
"JSON object to send under `initializationOptions'"
(:method (_s) nil)) ; blank default
@@ -886,6 +889,14 @@ Uses THING, FACE, DEFS and PREPEND."
"Handle unknown request"
(jsonrpc-error "Unknown request method `%s'" method))
+(cl-defmethod eglot-execute-command
+ (server command arguments)
+ "Execute command by making a :workspace/executeCommand request."
+ (jsonrpc-request
+ server
+ :workspace/executeCommand
+ `(:command ,command :arguments ,arguments)))
+
(cl-defmethod eglot-handle-notification
(_server (_method (eql window/showMessage)) &key type message)
"Handle notification window/showMessage"
@@ -1576,7 +1587,8 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
(keyboard-quit)
retval))))))
(if command-and-args
- (jsonrpc-request server :workspace/executeCommand command-and-args)
+ (eglot-execute-command server (plist-get command-and-args :command)
+ (plist-get command-and-args :arguments))
(eglot--message "No code actions here"))))
- [elpa] externals/eglot 9ae03af 39/62: Close #41: Control the size of the events buffer, (continued)
- [elpa] externals/eglot 9ae03af 39/62: Close #41: Control the size of the events buffer, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c25c0e3 40/62: Close #64: handle edits to same position in the correct order, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6874895 42/62: Close #73: Prompt for server in interactive eglot-shutdown, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot dc26745 38/62: Update README.md, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot e05360a 50/62: Actually add snippet example gif referenced in README.md, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c8cccee 52/62: Ignore extra keys in textDocument/publishDiagnostics (#81), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6f1d64c 59/62: Close #100: Don't send other notifications before initialized, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot f482c3e 60/62: Close #115: Don't block kill-buffer-hook if server somehow hangs, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 821b498 62/62: Correctly map DocumentSymbol's :kind to its name (#121), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot bd6304d 57/62: Fix serious breakage introduced by #93, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 8e1a91b 31/62: Add a generic eglot-execute-command API,
Stefan Monnier <=
- [elpa] externals/eglot d5167ea 29/62: Minor fixes to test infrastructure, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot b0b16e2 37/62: Allow tests to be run with custom jsonrpc.el, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 8e0cf60 45/62: Fix textDocument/hover responses where MarkedString is a plist (#72), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 40f151b 51/62: Close #80: Consider :triggerCharacters in company completion, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot e5b89af 53/62: Close #82: Correctly delete text before expanding snippet completions, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot f9beb19 55/62: When exiting emacs, don't ask the user to confirm killing processes (#83), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot badcaec 56/62: Don't warn on implementation-specific notifications (#93), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 042a236 49/62: * README.md (Obligatory animated gif section): Add snippet gif., Stefan Monnier, 2018/09/29
- [elpa] externals/eglot b061873 61/62: Autoload eglot-ensure (#120), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot f3f8531 58/62: Close #94: Prefer ccls over cquery for C/C++, Stefan Monnier, 2018/09/29