If flymake-mode is in eglot--managed-mode-hook, it will be called even
if eglot--managed-mode is being turned off, which could be problematic
because it triggers a check if flymake-start-on-flymake-mode is t.
* eglot.el (eglot--managed-mode): Turn on flymake-mode and
eldoc-mode here.
GitHub-reference: close https://github.com/joaotavora/eglot/issues/44
(add-hook 'change-major-mode-hook 'eglot--managed-mode-onoff nil t)
(add-function :before-until (local 'eldoc-documentation-function)
#'eglot-eldoc-function)
- (add-function :around (local 'imenu-create-index-function) #'eglot-imenu))
+ (add-function :around (local 'imenu-create-index-function) #'eglot-imenu)
+ (flymake-mode 1)
+ (eldoc-mode 1))
(t
(remove-hook 'flymake-diagnostic-functions 'eglot-flymake-backend t)
(remove-hook 'after-change-functions 'eglot--after-change t)
(setf (eglot--managed-buffers server)
(delq buf (eglot--managed-buffers server)))))))))
-(add-hook 'eglot--managed-mode-hook 'flymake-mode)
-(add-hook 'eglot--managed-mode-hook 'eldoc-mode)
-
(defun eglot--current-server ()
"Find the current logical EGLOT server."
(or