[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 1.2 7f8465c 025/101: Add a generic eglot-execute-command API
From: |
Christian Johansson |
Subject: |
[elpa] 1.2 7f8465c 025/101: Add a generic eglot-execute-command API |
Date: |
Thu, 29 Apr 2021 15:08:53 -0400 (EDT) |
tag: 1.2
commit 7f8465cd6b26f93f696fee7722c20fc6cfb7b19d
Author: Michał K <k.michal@zoho.com>
Commit: João Távora <joaotavora@gmail.com>
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] 1.2 802dea3 033/101: Close #41: Control the size of the events buffer, (continued)
- [elpa] 1.2 802dea3 033/101: Close #41: Control the size of the events buffer, Christian Johansson, 2021/04/29
- [elpa] 1.2 8ed2524 038/101: Close #50: Support snippet completions, Christian Johansson, 2021/04/29
- [elpa] 1.2 7583849 058/101: eglot-ignored-server-capabilites: Prefer all choices over "Other", Christian Johansson, 2021/04/29
- [elpa] 1.2 240f88c 050/101: Don't warn on implementation-specific notifications (#93), Christian Johansson, 2021/04/29
- [elpa] 1.2 ba9877f 048/101: Close #86: Handle case when :textDocumentSync isn't a number, Christian Johansson, 2021/04/29
- [elpa] 1.2 6788dbc 074/101: Don't ignore unknown SymbolKinds in imenu, Christian Johansson, 2021/04/29
- [elpa] 1.2 9bf41be 076/101: Larger margin for printing test failure backtraces, Christian Johansson, 2021/04/29
- [elpa] 1.2 4550c08 077/101: Re-enable eclipse-jdt tests, Christian Johansson, 2021/04/29
- [elpa] 1.2 e866ca5 079/101: Use the container name of a symbol in imenu, Christian Johansson, 2021/04/29
- [elpa] 1.2 065f71a 080/101: Add support for code action literals, Christian Johansson, 2021/04/29
- [elpa] 1.2 7f8465c 025/101: Add a generic eglot-execute-command API,
Christian Johansson <=
- [elpa] 1.2 d0ec044 041/101: Add go-langserver (#74), Christian Johansson, 2021/04/29
- [elpa] 1.2 6cbfdda 057/101: Make eglot-ignored-server-capabilites more user-friendly (#126), Christian Johansson, 2021/04/29
- [elpa] 1.2 d54e494 046/101: Ignore extra keys in textDocument/publishDiagnostics (#81), Christian Johansson, 2021/04/29
- [elpa] 1.2 2d3c391 007/101: Close #48: be less verbose when using eglot-ensure, Christian Johansson, 2021/04/29
- [elpa] 1.2 9c2fd8c 002/101: Close #44: Robustify in the face of manual mode changes, Christian Johansson, 2021/04/29
- [elpa] 1.2 4d80eeb 015/101: Default eglot-handle-notifictiona|request must &allow-other-keys, Christian Johansson, 2021/04/29
- [elpa] 1.2 d2faf6d 001/101: Close #29: Implement workspace/didChangeConfiguration (#40), Christian Johansson, 2021/04/29
- [elpa] 1.2 5aea589 013/101: Close #58: Erase company-doc buffer in between doc requests, Christian Johansson, 2021/04/29
- [elpa] 1.2 5707785 024/101: * eglot.el (eglot-cquery): Capitalize docstring., Christian Johansson, 2021/04/29
- [elpa] 1.2 6067ec6 023/101: Minor fixes to test infrastructure, Christian Johansson, 2021/04/29