Function: eglot--post-self-insert-hook
eglot--post-self-insert-hook is a byte-compiled function defined in
eglot.el.gz.
Signature
(eglot--post-self-insert-hook)
Documentation
Set eglot--last-inserted-char, maybe call on-type-formatting.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/eglot.el.gz
(defun eglot--post-self-insert-hook ()
"Set `eglot--last-inserted-char', maybe call on-type-formatting."
(setq eglot--last-inserted-char last-input-event)
(let ((ot-provider (eglot--server-capable :documentOnTypeFormattingProvider)))
(when (and ot-provider
(ignore-errors ; github#906, some LS's send empty strings
(or (eq last-input-event
(seq-first (plist-get ot-provider :firstTriggerCharacter)))
(cl-find last-input-event
(plist-get ot-provider :moreTriggerCharacter)
:key #'seq-first))))
(eglot-format (point) nil last-input-event))))