d314cc7eef
To optimise performance of lsp mode in emacs 27 and above I have introduced a new dotfile variable to define the size of data read from external processes. The default I have set to the recommended setting from lsp-mode. In addition I have introduced a new layer variable for auto-complete-layer to define the minimum prefix length. I have also added instructions to auto-complete's readme how to set these variables to the recommended settings for lsp-mode. Changes inspired from #13507
63 lines
1.9 KiB
EmacsLisp
63 lines
1.9 KiB
EmacsLisp
;;; packages.el --- Language Server Protocol Layer packages file for Spacemacs
|
|
;;
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
|
;;
|
|
;; Author: Fangrui Song <i@maskray.me>
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
;;
|
|
;; This file is not part of GNU Emacs.
|
|
;;
|
|
;;; License: GPLv3
|
|
|
|
(defconst lsp-packages
|
|
'(
|
|
(lsp-mode :requires yasnippet)
|
|
lsp-ui
|
|
(helm-lsp :requires helm)
|
|
(lsp-ivy :requires ivy)
|
|
(lsp-treemacs :requires treemacs)
|
|
popwin))
|
|
|
|
(defun lsp/init-lsp-mode ()
|
|
(use-package lsp-mode
|
|
:defer t
|
|
:config
|
|
(progn
|
|
(require 'lsp-clients)
|
|
(spacemacs/lsp-bind-keys)
|
|
(setq lsp-prefer-capf t)
|
|
(add-hook 'lsp-after-open-hook (lambda ()
|
|
"Setup xref jump handler and declare keybinding prefixes"
|
|
(spacemacs//setup-lsp-jump-handler)
|
|
(spacemacs//lsp-declare-prefixes-for-mode major-mode))))))
|
|
|
|
(defun lsp/init-lsp-ui ()
|
|
(use-package lsp-ui
|
|
:defer t
|
|
:config
|
|
(progn
|
|
(if lsp-remap-xref-keybindings
|
|
(progn (define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
|
|
(define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references)))
|
|
|
|
(spacemacs/lsp-define-key
|
|
lsp-ui-peek-mode-map
|
|
"h" #'lsp-ui-peek--select-prev-file
|
|
"j" #'lsp-ui-peek--select-next
|
|
"k" #'lsp-ui-peek--select-prev
|
|
"l" #'lsp-ui-peek--select-next-file
|
|
)
|
|
)))
|
|
|
|
(defun lsp/init-helm-lsp ()
|
|
(use-package helm-lsp :defer t))
|
|
|
|
(defun lsp/init-lsp-ivy ()
|
|
(use-package lsp-ivy :defer t))
|
|
|
|
(defun lsp/init-lsp-treemacs ()
|
|
(use-package lsp-treemacs :defer t))
|
|
|
|
(defun lsp/post-init-popwin ()
|
|
(push '("*lsp-help*" :dedicated t :position bottom :stick t :noselect t :height 0.4)
|
|
popwin:special-display-config))
|