emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/elpa 0ec7801 012/139: Simplify `eglot--protocol-initial


From: João Távora
Subject: [elpa] externals/elpa 0ec7801 012/139: Simplify `eglot--protocol-initialize`
Date: Mon, 14 May 2018 09:53:25 -0400 (EDT)

branch: externals/elpa
commit 0ec78011fee3be96f110fc37756a9baac6595348
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Simplify `eglot--protocol-initialize`
    
    * eglot.el (eglot--protocol-initialize): Simplify
---
 eglot.el | 29 +++++++----------------------
 1 file changed, 7 insertions(+), 22 deletions(-)

diff --git a/eglot.el b/eglot.el
index cd91d78..b59ee02 100644
--- a/eglot.el
+++ b/eglot.el
@@ -70,7 +70,7 @@
   "Point where next unread message starts")
 
 (eglot--define-process-var eglot--short-name nil
-  "A short name")
+  "A short name for the process")
 
 (eglot--define-process-var eglot--expected-bytes nil
   "How many bytes declared by server")
@@ -81,6 +81,9 @@
 (eglot--define-process-var eglot--events-buffer nil
   "A buffer pretty-printing the EGLOT RPC events")
 
+(eglot--define-process-var eglot--capabilities :unreported
+  "Holds list of capabilities that server reported")
+
 (cl-defmacro eglot--request (process
                               method
                               params
@@ -367,29 +370,11 @@
                  :capabilities (:workspace (:executeCommand 
(:dynamicRegistration t))
                                            :textDocument (:synchronization 
(:didSave t))))
    (lambda (&key capabilities)
-     (cl-destructuring-bind
-         (&rest all
-                &key
-                ;; capabilities reported by server
-                _textDocumentSync
-                _hoverProvider
-                _completionProvider
-                _definitionProvider
-                _referencesProvider
-                _documentHighlightProvider
-                _documentSymbolProvider
-                _workspaceSymbolProvider
-                _codeActionProvider
-                _documentFormattingProvider
-                _documentRangeFormattingProvider
-                _renameProvider
-                _executeCommandProvider
-                )
-         capabilities
-       (when interactive
+     (setf (eglot--capabilities process) capabilities)
+     (when interactive
          (eglot--message
           "So yeah I got lots (%d) of capabilities"
-          (length all)))))))
+          (length capabilities))))))
 
 (defun eglot-quit-server (process &optional sync)
   (interactive (list (eglot--current-process-or-lose)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]