2018-03-16 00:38:24 +00:00
|
|
|
;;; packages.el --- Language Server Protocol Layer packages file for Spacemacs
|
2018-02-19 03:53:07 +00:00
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2018-02-19 03:53:07 +00:00
|
|
|
;;
|
|
|
|
;; Author: Fangrui Song <i@maskray.me>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2018-02-19 03:53:07 +00:00
|
|
|
|
2018-01-21 20:27:33 +00:00
|
|
|
(defconst lsp-packages
|
|
|
|
'(
|
2020-06-26 17:39:22 +00:00
|
|
|
lsp-mode
|
2021-02-20 18:50:38 +00:00
|
|
|
(lsp-ui :toggle lsp-use-lsp-ui)
|
2019-07-18 16:25:08 +00:00
|
|
|
(helm-lsp :requires helm)
|
2020-04-16 04:43:47 +00:00
|
|
|
(lsp-ivy :requires ivy)
|
2019-07-18 16:25:08 +00:00
|
|
|
(lsp-treemacs :requires treemacs)
|
2020-09-16 09:20:30 +00:00
|
|
|
(lsp-origami :requires lsp-mode)
|
2020-05-15 20:07:17 +00:00
|
|
|
popwin))
|
2018-03-16 00:38:24 +00:00
|
|
|
|
|
|
|
(defun lsp/init-lsp-mode ()
|
|
|
|
(use-package lsp-mode
|
|
|
|
:defer t
|
|
|
|
:config
|
|
|
|
(progn
|
2018-11-22 10:56:35 +00:00
|
|
|
(spacemacs/lsp-bind-keys)
|
2020-05-15 20:07:17 +00:00
|
|
|
(setq lsp-prefer-capf t)
|
2018-11-22 10:56:35 +00:00
|
|
|
(add-hook 'lsp-after-open-hook (lambda ()
|
2020-11-21 06:34:55 +00:00
|
|
|
"Setup xref jump handler"
|
|
|
|
(spacemacs//setup-lsp-jump-handler))))))
|
2018-01-21 20:27:33 +00:00
|
|
|
|
|
|
|
(defun lsp/init-lsp-ui ()
|
|
|
|
(use-package lsp-ui
|
2018-06-11 03:25:45 +00:00
|
|
|
:defer t
|
2018-01-21 20:27:33 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2018-09-20 15:59:40 +00:00
|
|
|
(if lsp-remap-xref-keybindings
|
2020-04-02 16:41:28 +00:00
|
|
|
(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)))
|
2018-03-16 00:38:24 +00:00
|
|
|
|
|
|
|
(spacemacs/lsp-define-key
|
2020-04-02 16:41:28 +00:00
|
|
|
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
|
|
|
|
)
|
2018-03-16 00:38:24 +00:00
|
|
|
)))
|
|
|
|
|
2019-04-14 08:47:21 +00:00
|
|
|
(defun lsp/init-helm-lsp ()
|
|
|
|
(use-package helm-lsp :defer t))
|
|
|
|
|
2020-04-16 04:43:47 +00:00
|
|
|
(defun lsp/init-lsp-ivy ()
|
|
|
|
(use-package lsp-ivy :defer t))
|
|
|
|
|
2019-04-14 08:47:21 +00:00
|
|
|
(defun lsp/init-lsp-treemacs ()
|
|
|
|
(use-package lsp-treemacs :defer t))
|
2019-07-08 12:27:34 +00:00
|
|
|
|
2020-09-16 09:20:30 +00:00
|
|
|
(defun lsp/init-lsp-origami ()
|
|
|
|
(use-package lsp-origami
|
|
|
|
:defer t
|
2020-09-17 21:54:22 +00:00
|
|
|
:init
|
|
|
|
(add-hook 'lsp-after-open-hook #'lsp-origami-try-enable)))
|
2020-09-16 09:20:30 +00:00
|
|
|
|
2020-07-03 19:44:51 +00:00
|
|
|
(defun lsp/pre-init-popwin ()
|
|
|
|
(spacemacs|use-package-add-hook popwin
|
|
|
|
:post-config
|
|
|
|
(push '("*lsp-help*" :dedicated t :position bottom :stick t :noselect t :height 0.4)
|
|
|
|
popwin:special-display-config)))
|