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

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

[elpa] externals/elpa 72895ca 006/139: Handle notifications


From: João Távora
Subject: [elpa] externals/elpa 72895ca 006/139: Handle notifications
Date: Mon, 14 May 2018 09:53:24 -0400 (EDT)

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

    Handle notifications
---
 eglot.el | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/eglot.el b/eglot.el
index 5ca6833..6e3a136 100644
--- a/eglot.el
+++ b/eglot.el
@@ -287,8 +287,13 @@
                  (t
                   (apply (first continuations) (plist-get message :result)))))
           (t
-           (eglot--debug "No implemetation for notification %s yet"
-                         (plist-get message :method))))))
+           (let* ((method (plist-get message :method))
+                  (handler-sym (intern (concat "eglot--"
+                                              method))))
+             (if (functionp handler-sym)
+                 (apply handler-sym proc (plist-get message :params))
+               (eglot--debug "No implemetation for notification %s yet"
+                         method)))))))
 
 (defvar eglot--expect-carriage-return nil)
 
@@ -391,6 +396,14 @@
           (length all)))))))
 
 (defun eglot--debug (format &rest args)
+
+;;; Notifications
+;;;
+(cl-defun eglot--textDocument/publishDiagnostics
+    (_process &key uri diagnostics)
+  "Handle notification publishDiagnostics"
+  (eglot--message "So yeah I got %s for %s"
+                  diagnostics uri))
   (display-warning 'eglot
      (apply #'format format args)
      :debug))



reply via email to

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