[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 5bbf884 11/26: Use eglot--dbind for destructuring
From: |
João Távora |
Subject: |
[elpa] externals/eglot 5bbf884 11/26: Use eglot--dbind for destructuring |
Date: |
Sun, 9 Dec 2018 19:11:27 -0500 (EST) |
branch: externals/eglot
commit 5bbf88459b78205ece715af3b074cc046294e478
Author: Michał Krzywkowski <address@hidden>
Commit: João Távora <address@hidden>
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] externals/eglot updated (f291816 -> 23accee), João Távora, 2018/12/09
- [elpa] externals/eglot 11eb256 02/26: Fix #164: CodeAction command can be a Command object (#165), João Távora, 2018/12/09
- [elpa] externals/eglot 10b238b 03/26: Revert "Fix #164: CodeAction command can be a Command object (#165)", João Távora, 2018/12/09
- [elpa] externals/eglot cddab30 06/26: * eglot.el (eglot--current-column): New helper., João Távora, 2018/12/09
- [elpa] externals/eglot 53bfdb7 19/26: Per #173: adjust previous fix, João Távora, 2018/12/09
- [elpa] externals/eglot 9fb5f0c 05/26: Per #52, #127: Improve performance of xref summary line collection, João Távora, 2018/12/09
- [elpa] externals/eglot 5bbf884 11/26: Use eglot--dbind for destructuring,
João Távora <=
- [elpa] externals/eglot 81d035f 04/26: Fix #52: Use entire line as xref summary when available, João Távora, 2018/12/09
- [elpa] externals/eglot 96169d8 18/26: Per #173: fix bug introduced by previous fix, João Távora, 2018/12/09
- [elpa] externals/eglot 4874c22 14/26: Use javascript-typescript-langserver for typescript-mode (#174), João Távora, 2018/12/09
- [elpa] externals/eglot 66a1704 22/26: Scratch/use elpa flymake (#178), João Távora, 2018/12/09
- [elpa] externals/eglot f63bedb 20/26: Fix #144: Use eglot--dbind and eglot--lambda throughout, João Távora, 2018/12/09
- [elpa] externals/eglot 3922cf3 01/26: Per #144, #156: control strictness towards incoming LSP messages, João Távora, 2018/12/09
- [elpa] externals/eglot 8140be5 07/26: Touch up last commit, João Távora, 2018/12/09
- [elpa] externals/eglot 95ef9e1 08/26: Robustify tests against (M)ELPA eglot installations, João Távora, 2018/12/09
- [elpa] externals/eglot 38da3d3 15/26: Fix #159: Properly clear old diagnostics when making new ones, João Távora, 2018/12/09
- [elpa] externals/eglot 444a8c3 16/26: Per #173: robustify previous fix against non-standard insertion bindings, João Távora, 2018/12/09