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
|
|
|
;;
|
|
|
|
;; 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
|
|
|
|
|
2018-01-21 20:27:33 +00:00
|
|
|
(defconst lsp-packages
|
|
|
|
'(
|
2019-11-02 05:56:04 +00:00
|
|
|
(lsp-mode :requires yasnippet)
|
2019-04-14 08:47:21 +00:00
|
|
|
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)
|
2019-07-08 12:27:34 +00:00
|
|
|
popwin
|
2019-04-14 08:47:21 +00:00
|
|
|
))
|
2018-03-16 00:38:24 +00:00
|
|
|
|
|
|
|
(defun lsp/init-lsp-mode ()
|
|
|
|
(use-package lsp-mode
|
|
|
|
:defer t
|
|
|
|
:config
|
|
|
|
(progn
|
2018-12-09 08:00:14 +00:00
|
|
|
(require 'lsp-clients)
|
2018-11-22 10:56:35 +00:00
|
|
|
(spacemacs/lsp-bind-keys)
|
|
|
|
(add-hook 'lsp-after-open-hook (lambda ()
|
|
|
|
"Setup xref jump handler and declare keybinding prefixes"
|
2019-03-25 10:47:46 +00:00
|
|
|
(spacemacs//setup-lsp-jump-handler)
|
2018-12-11 21:59:25 +00:00
|
|
|
(spacemacs//lsp-declare-prefixes-for-mode major-mode))))))
|
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
|
|
|
|
|
|
|
(defun lsp/post-init-popwin ()
|
|
|
|
(push '("*lsp-help*" :dedicated t :position bottom :stick t :noselect t :height 0.4)
|
|
|
|
popwin:special-display-config))
|