(delq (current-buffer) (eglot--managed-buffers server)))
(when (and eglot-autoshutdown
(null (eglot--managed-buffers server)))
- (eglot-shutdown server))))))
- ;; Note: the public hook runs before the internal eglot--managed-mode-hook.
- (run-hooks 'eglot-managed-mode-hook))
+ (eglot-shutdown server)))))))
(defun eglot--managed-mode-off ()
"Turn off `eglot--managed-mode' unconditionally."
(when (and buffer-file-name (eglot-current-server))
(setq eglot--diagnostics nil)
(eglot--managed-mode)
- (eglot--signal-textDocument/didOpen))))
+ (eglot--signal-textDocument/didOpen)
+ ;; Run user hook after 'textDocument/didOpen' so server knows
+ ;; about the buffer.
+ (run-hooks 'eglot-managed-mode-hook))))
(add-hook 'find-file-hook 'eglot--maybe-activate-editing-mode)
(add-hook 'after-change-major-mode-hook 'eglot--maybe-activate-editing-mode)