From: João Távora Date: Wed, 16 Aug 2017 11:49:24 +0000 (+0100) Subject: Handle notifications X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~701 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=18b582dde2ef0275561a66fb292823f559ed7a0b;p=emacs.git Handle notifications --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 5ca6833de71..6e3a1365962 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/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))