From: João Távora Date: Thu, 3 May 2018 10:49:24 +0000 (+0100) Subject: Signal textdocument/didclose X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~669 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=976896f2c34034a495c72096daeadeb2a9ab4846;p=emacs.git Signal textdocument/didclose * eglot.el (eglot-editing-mode): Signal didClose. (eglot--signalDidClose): New. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 12e7fef08c4..85844409f34 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -671,6 +671,7 @@ running. INTERACTIVE is t if called interactively." (eglot-mode 1) (add-hook 'after-change-functions 'eglot--after-change nil t) (add-hook 'flymake-diagnostic-functions 'eglot-flymake-backend nil t) + (add-hook 'kill-buffer-hook 'eglot--signalDidClose nil t) (flymake-mode 1) (if (eglot--current-process) (eglot--signalDidOpen) @@ -679,7 +680,8 @@ running. INTERACTIVE is t if called interactively." (eglot--warn "No process")))) (t (remove-hook 'flymake-diagnostic-functions 'eglot-flymake-backend t) - (remove-hook 'after-change-functions 'eglot--after-change t)))) + (remove-hook 'after-change-functions 'eglot--after-change t) + (remove-hook 'kill-buffer-hook 'eglot--signalDidClose t)))) (define-minor-mode eglot-mode "Minor mode for all buffers managed by EGLOT in some way." nil @@ -832,6 +834,12 @@ running. INTERACTIVE is t if called interactively." (eglot--obj :textDocument (eglot--current-buffer-TextDocumentItem)))) +(defun eglot--signalDidClose () + (eglot--notify (eglot--current-process-or-lose) + :textDocument/didClose + (eglot--obj :textDocument + (eglot--current-buffer-TextDocumentItem)))) + (defun eglot--maybe-signal-didChange () (when eglot--recent-changes (save-excursion