2020-05-28 11:03:49 +02:00
|
|
|
;;; tools/lsp/+eglot.el -*- lexical-binding: t; -*-
|
|
|
|
|
2020-05-28 15:30:20 -04:00
|
|
|
;; TODO set eglot-events-buffer-size to nil in doom-debug-mode
|
|
|
|
;; TODO Implement `+lsp-defer-shutdown'
|
|
|
|
|
2020-05-28 11:03:49 +02:00
|
|
|
(use-package! eglot
|
2020-05-28 15:30:20 -04:00
|
|
|
:commands eglot eglot-ensure
|
2020-08-11 21:10:35 -04:00
|
|
|
:hook (eglot-managed-mode . +lsp-init-optimizations-h)
|
2020-05-28 11:03:49 +02:00
|
|
|
:init
|
|
|
|
(setq eglot-sync-connect 1
|
|
|
|
eglot-connect-timeout 10
|
|
|
|
eglot-autoshutdown t
|
|
|
|
eglot-send-changes-idle-time 0.5
|
2020-05-28 15:30:20 -04:00
|
|
|
;; NOTE We disable eglot-auto-display-help-buffer because :select t in
|
|
|
|
;; its popup rule causes eglot to steal focus too often.
|
2020-05-28 11:03:49 +02:00
|
|
|
eglot-auto-display-help-buffer nil)
|
2020-05-28 15:30:20 -04:00
|
|
|
|
2020-05-28 11:03:49 +02:00
|
|
|
:config
|
|
|
|
(set-popup-rule! "^\\*eglot-help" :size 0.35 :quit t :select t)
|
2020-05-28 15:30:20 -04:00
|
|
|
(set-lookup-handlers! 'eglot--managed-mode
|
2020-05-29 16:52:31 +09:00
|
|
|
:implementations #'eglot-find-implementation
|
|
|
|
:type-definition #'eglot-find-typeDefinition
|
2020-05-28 15:30:20 -04:00
|
|
|
:documentation #'+eglot/documentation-lookup-handler)
|
2020-05-28 11:03:49 +02:00
|
|
|
(when (featurep! :checkers syntax)
|
2020-05-28 11:12:35 +02:00
|
|
|
(after! flycheck
|
2020-05-28 15:30:20 -04:00
|
|
|
(load! "autoload/flycheck-eglot"))))
|