eglot 在 minibuffer 中显示错误信息

2022-07-26 16:52:28 浏览数 (3)

eglot 用得一直很顺,有一点不舒服的地方在于:当有错误时,必须把鼠标移上去才能看到,有些不符合全键盘的哲学理念。

解法其实也很简单,就是修改下 eldoc-documentation-functions 就好了。可参考:

代码语言:javascript复制
(defun my/eglot-hook ()
  "Show flymake diagnostics first.
https://github.com/joaotavora/eglot/discussions/898#discussioncomment-2609402"
  (setq eldoc-documentation-functions
        (cons #'flymake-eldoc-function
              (remove #'flymake-eldoc-function eldoc-documentation-functions))))

(add-hook 'eglot-managed-mode-hook 'my/eglot-hook)

效果如下:

0 人点赞