[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 1.3 9e7f370 11/26: Use eglot--dbind for destructuring
From: |
Christian Johansson |
Subject: |
[elpa] 1.3 9e7f370 11/26: Use eglot--dbind for destructuring |
Date: |
Thu, 29 Apr 2021 15:09:14 -0400 (EDT) |
tag: 1.3
commit 9e7f370d1e75e50dc1e2badb0800a91134ff4a81
Author: Michał Krzywkowski <k.michal@zoho.com>
Commit: João Távora <joaotavora@gmail.com>
Use eglot--dbind for destructuring
* eglot.el (eglot--lsp-interface-alist): Add CodeAction,
FileSystemWatcher, Registration, TextDocumentEdit, WorkspaceEdit.
(eglot-handle-notification): Use eglot--dbind.
(eglot--apply-workspace-edit): Use eglot--dbind and eglot--lambda.
(eglot-code-actions): Use eglot--lambda.
(eglot--register-workspace/didChangeWatchedFiles): Use eglot--lambda.
---
eglot.el | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/eglot.el b/eglot.el
index 61f9b70..8d39770 100644
--- a/eglot.el
+++ b/eglot.el
@@ -201,7 +201,14 @@ let the buffer grow forever."
;;; Message verification helpers
;;;
-(defvar eglot--lsp-interface-alist `()
+(defvar eglot--lsp-interface-alist
+ `(
+ (CodeAction (:title) (:kind :diagnostics :edit :command))
+ (FileSystemWatcher (:globPattern) (:kind))
+ (Registration (:id :method) (:registerOptions))
+ (TextDocumentEdit (:textDocument :edits) ())
+ (WorkspaceEdit () (:changes :documentChanges))
+ )
"Alist (INTERFACE-NAME . INTERFACE) of known external LSP interfaces.
INTERFACE-NAME is a symbol designated by the spec as
@@ -1314,7 +1321,7 @@ COMMAND is a symbol naming the command."
THINGS are either registrations or unregisterations."
(cl-loop
for thing in (cl-coerce things 'list)
- collect (cl-destructuring-bind (&key id method registerOptions) thing
+ collect (eglot--dbind ((Registration) id method registerOptions) thing
(apply (intern (format "eglot--%s-%s" how method))
server :id id registerOptions))
into results
@@ -1990,9 +1997,9 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
(defun eglot--apply-workspace-edit (wedit &optional confirm)
"Apply the workspace edit WEDIT. If CONFIRM, ask user first."
- (cl-destructuring-bind (&key changes documentChanges) wedit
+ (eglot--dbind ((WorkspaceEdit) changes documentChanges) wedit
(let ((prepared
- (mapcar (jsonrpc-lambda (&key textDocument edits)
+ (mapcar (eglot--lambda ((TextDocumentEdit) textDocument edits)
(cl-destructuring-bind (&key uri version) textDocument
(list (eglot--uri-to-path uri) edits version)))
documentChanges))
@@ -2057,8 +2064,7 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
(eglot--diag-data diag))))
(flymake-diagnostics beg end))]))))
(menu-items
- (or (mapcar (jsonrpc-lambda (&key title command arguments
- edit _kind _diagnostics)
+ (or (mapcar (eglot--lambda ((CodeAction) title edit command
arguments)
`(,title . (:command ,command :arguments ,arguments
:edit ,edit)))
actions)
@@ -2098,7 +2104,9 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
"Handle dynamic registration of workspace/didChangeWatchedFiles"
(eglot--unregister-workspace/didChangeWatchedFiles server :id id)
(let* (success
- (globs (mapcar (lambda (w) (plist-get w :globPattern)) watchers)))
+ (globs (mapcar (eglot--lambda ((FileSystemWatcher) globPattern)
+ globPattern)
+ watchers)))
(cl-labels
((handle-event
(event)
- [elpa] 1.3 8c71a1a 18/26: Per #173: fix bug introduced by previous fix, (continued)
- [elpa] 1.3 8c71a1a 18/26: Per #173: fix bug introduced by previous fix, Christian Johansson, 2021/04/29
- [elpa] 1.3 84a271c 08/26: Robustify tests against (M)ELPA eglot installations, Christian Johansson, 2021/04/29
- [elpa] 1.3 0f74616 07/26: Touch up last commit, Christian Johansson, 2021/04/29
- [elpa] 1.3 dc84ff6 06/26: * eglot.el (eglot--current-column): New helper., Christian Johansson, 2021/04/29
- [elpa] 1.3 5595a75 12/26: Fix #116, #150: don't break in indirect buffers, Christian Johansson, 2021/04/29
- [elpa] 1.3 72e06ea 14/26: Use javascript-typescript-langserver for typescript-mode (#174), Christian Johansson, 2021/04/29
- [elpa] 1.3 4fbbe9c 19/26: Per #173: adjust previous fix, Christian Johansson, 2021/04/29
- [elpa] 1.3 8a2008f 21/26: Warn about suspicious interface usage at compile-time, Christian Johansson, 2021/04/29
- [elpa] 1.3 3082a85 02/26: Fix #164: CodeAction command can be a Command object (#165), Christian Johansson, 2021/04/29
- [elpa] 1.3 7d41833 05/26: Per #52, #127: Improve performance of xref summary line collection, Christian Johansson, 2021/04/29
- [elpa] 1.3 9e7f370 11/26: Use eglot--dbind for destructuring,
Christian Johansson <=
- [elpa] 1.3 c3d2000 26/26: * eglot.el (Version): Bump to 1.3, Christian Johansson, 2021/04/29
- [elpa] 1.3 dfa648d 24/26: Be lenient by default to unknown methods or notifications, Christian Johansson, 2021/04/29
- [elpa] 1.3 0c36b00 25/26: Close #180: Add preamble to comparison to lsp-mode.el, Christian Johansson, 2021/04/29
- [elpa] 1.3 f0bdf4c 20/26: Fix #144: Use eglot--dbind and eglot--lambda throughout, Christian Johansson, 2021/04/29
- [elpa] 1.3 0005dc8 22/26: Scratch/use elpa flymake (#178), Christian Johansson, 2021/04/29
- [elpa] 1.3 3a56470 17/26: Fix #164: handle CodeAction/Command polymorphism with eglot--dcase, Christian Johansson, 2021/04/29
- [elpa] 1.3 6643310 16/26: Per #173: robustify previous fix against non-standard insertion bindings, Christian Johansson, 2021/04/29