parent
059a70b74b
commit
e2077c823a
1 changed files with 26 additions and 16 deletions
|
@ -1,8 +1,9 @@
|
||||||
;;; tools/lsp/+lsp.el -*- lexical-binding: t; -*-
|
;;; tools/lsp/+lsp.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defvar +lsp-company-backends (if (featurep! :editor snippets)
|
(defvar +lsp-company-backends
|
||||||
'(:separate company-capf company-yasnippet)
|
(if (featurep! :editor snippets)
|
||||||
'company-capf)
|
'(:separate company-capf company-yasnippet)
|
||||||
|
'company-capf)
|
||||||
"The backends to prepend to `company-backends' in `lsp-mode' buffers.
|
"The backends to prepend to `company-backends' in `lsp-mode' buffers.
|
||||||
Can be a list of backends; accepts any value `company-backends' accepts.")
|
Can be a list of backends; accepts any value `company-backends' accepts.")
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ about it (it will be logged to *Messages* however).")
|
||||||
(setq lsp-keymap-prefix nil))
|
(setq lsp-keymap-prefix nil))
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(pushnew! doom-debug-variables 'lsp-log-io 'lsp-print-performance)
|
(add-to-list 'doom-debug-variables 'lsp-log-io)
|
||||||
|
|
||||||
(setq lsp-intelephense-storage-path (concat doom-etc-dir "lsp-intelephense/")
|
(setq lsp-intelephense-storage-path (concat doom-etc-dir "lsp-intelephense/")
|
||||||
lsp-vetur-global-snippets-dir
|
lsp-vetur-global-snippets-dir
|
||||||
|
@ -155,16 +156,31 @@ server getting expensively restarted when reverting buffers."
|
||||||
|
|
||||||
|
|
||||||
(use-package! lsp-ui
|
(use-package! lsp-ui
|
||||||
:defer t
|
:hook (lsp-mode . lsp-ui-mode)
|
||||||
|
:hook (lsp-ui . lsp-ui-sideline-mode)
|
||||||
|
:hook (lsp-ui . lsp-ui-doc-mode)
|
||||||
:config
|
:config
|
||||||
|
;; For some reason `lsp-ui' doesn't actually use the `lsp-ui-doc-enable' and
|
||||||
|
;; `lsp-ui-sideline-enable' variables, so we fix that.
|
||||||
|
(defadvice! +lsp--ui-doc-only-if-enabled-a (&rest _)
|
||||||
|
:before-while #'lsp-ui-doc-mode
|
||||||
|
lsp-ui-doc-enable)
|
||||||
|
|
||||||
|
(defadvice! +lsp--ui-sideline-only-if-enabled-a (&rest _)
|
||||||
|
:before-while 'lsp-ui-sideline-mode
|
||||||
|
lsp-ui-sideline-enable)
|
||||||
|
|
||||||
|
(when (featurep! +peek)
|
||||||
|
(set-lookup-handlers! 'lsp-ui-mode
|
||||||
|
:definition 'lsp-ui-peek-find-definitions
|
||||||
|
:implementations 'lsp-ui-peek-find-implementation
|
||||||
|
:references 'lsp-ui-peek-find-references))
|
||||||
|
|
||||||
(setq lsp-ui-doc-max-height 8
|
(setq lsp-ui-doc-max-height 8
|
||||||
lsp-ui-doc-max-width 35
|
lsp-ui-doc-max-width 35
|
||||||
lsp-ui-sideline-ignore-duplicate t
|
|
||||||
;; lsp-ui-doc is redundant with and more invasive than
|
|
||||||
;; `+lookup/documentation'
|
|
||||||
lsp-ui-doc-enable nil
|
|
||||||
lsp-ui-doc-show-with-mouse nil ; don't disappear on mouseover
|
lsp-ui-doc-show-with-mouse nil ; don't disappear on mouseover
|
||||||
lsp-ui-doc-position 'at-point
|
lsp-ui-doc-position 'at-point
|
||||||
|
lsp-ui-sideline-ignore-duplicate t
|
||||||
;; Don't show symbol definitions in the sideline. They are pretty noisy,
|
;; Don't show symbol definitions in the sideline. They are pretty noisy,
|
||||||
;; and there is a bug preventing Flycheck errors from being shown (the
|
;; and there is a bug preventing Flycheck errors from being shown (the
|
||||||
;; errors flash briefly and then disappear).
|
;; errors flash briefly and then disappear).
|
||||||
|
@ -177,13 +193,7 @@ server getting expensively restarted when reverting buffers."
|
||||||
"j" #'lsp-ui-peek--select-next
|
"j" #'lsp-ui-peek--select-next
|
||||||
"k" #'lsp-ui-peek--select-prev
|
"k" #'lsp-ui-peek--select-prev
|
||||||
"C-k" #'lsp-ui-peek--select-prev-file
|
"C-k" #'lsp-ui-peek--select-prev-file
|
||||||
"C-j" #'lsp-ui-peek--select-next-file)
|
"C-j" #'lsp-ui-peek--select-next-file))
|
||||||
|
|
||||||
(when (featurep! +peek)
|
|
||||||
(set-lookup-handlers! 'lsp-ui-mode :async t
|
|
||||||
:definition 'lsp-ui-peek-find-definitions
|
|
||||||
:implementations 'lsp-ui-peek-find-implementation
|
|
||||||
:references 'lsp-ui-peek-find-references)))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package! helm-lsp
|
(use-package! helm-lsp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue