tools/lsp: minor refactors

This commit is contained in:
Henrik Lissner 2020-05-28 15:30:20 -04:00
parent 92760d91ae
commit d502c7c06a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 14 additions and 7 deletions

View file

@ -1,19 +1,23 @@
;;; tools/lsp/+eglot.el -*- lexical-binding: t; -*- ;;; tools/lsp/+eglot.el -*- lexical-binding: t; -*-
;; TODO set eglot-events-buffer-size to nil in doom-debug-mode
;; TODO Implement `+lsp-defer-shutdown'
(use-package! eglot (use-package! eglot
:commands (eglot-ensure eglot) :commands eglot eglot-ensure
:init :init
(setq eglot-sync-connect 1 (setq eglot-sync-connect 1
eglot-connect-timeout 10 eglot-connect-timeout 10
eglot-autoshutdown t eglot-autoshutdown t
eglot-send-changes-idle-time 0.5 eglot-send-changes-idle-time 0.5
;; NOTE: Do NOT set eglot-auto-display-help-buffer to t. ;; NOTE We disable eglot-auto-display-help-buffer because :select t in
;; With popup-rule! :select t, eglot will steal focus from the source code very often. ;; its popup rule causes eglot to steal focus too often.
eglot-auto-display-help-buffer nil) eglot-auto-display-help-buffer nil)
:config :config
(set-popup-rule! "^\\*eglot-help" :size 0.35 :quit t :select t) (set-popup-rule! "^\\*eglot-help" :size 0.35 :quit t :select t)
(set-lookup-handlers! 'eglot--managed-mode
:documentation #'+eglot/documentation-lookup-handler)
(when (featurep! :checkers syntax) (when (featurep! :checkers syntax)
(after! flycheck (after! flycheck
(load! "autoload/flycheck-eglot"))) (load! "autoload/flycheck-eglot"))))
(set-lookup-handlers! 'eglot--managed-mode
:documentation #'+eglot/documentation-lookup-handler))

View file

@ -7,7 +7,10 @@ workspace buffer is closed.
This delay prevents premature server shutdown when a user still intends on This delay prevents premature server shutdown when a user still intends on
working on that project after closing the last buffer.") working on that project after closing the last buffer.")
;; TODO : set eglot-events-buffer-size to nil in doom-debug-mode
;;
;;; Implementations
(if (featurep! +eglot) (if (featurep! +eglot)
(load! "+eglot") (load! "+eglot")
(load! "+lsp")) (load! "+lsp"))