2018-02-19 03:53:07 +00:00
|
|
|
;;; packages.el --- Language Server Protocol 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
|
|
|
|
|
2018-01-21 20:27:33 +00:00
|
|
|
(defconst lsp-packages
|
|
|
|
'(
|
|
|
|
(company-lsp :requires company)
|
2018-02-19 03:56:41 +00:00
|
|
|
;; `flycheck-lsp' does not exist so we defined it as built-in to avoid
|
|
|
|
;; fetching it from ELPA repositories.
|
|
|
|
;; this logical package serves to hook all flycheck related configuration
|
|
|
|
;; for LSP.
|
|
|
|
(flycheck-lsp :requires flycheck :location built-in)
|
2018-01-21 20:27:33 +00:00
|
|
|
lsp-mode
|
|
|
|
lsp-ui
|
|
|
|
))
|
|
|
|
|
|
|
|
(defun lsp/init-company-lsp ()
|
|
|
|
(use-package company-lsp
|
|
|
|
:init
|
|
|
|
;; Language servers have better idea filtering and sorting,
|
|
|
|
;; don't filter results on the client side.
|
|
|
|
(setq company-transformers nil
|
|
|
|
company-lsp-async t
|
2018-02-19 03:48:12 +00:00
|
|
|
company-lsp-cache-candidates nil)))
|
2018-01-21 20:27:33 +00:00
|
|
|
|
2018-02-19 03:56:41 +00:00
|
|
|
(defun lsp/init-flycheck-lsp ()
|
|
|
|
;; Disable lsp-flycheck.el in favor of lsp-ui-flycheck.el
|
|
|
|
(setq lsp-enable-flycheck nil))
|
|
|
|
|
2018-01-21 20:27:33 +00:00
|
|
|
(defun lsp/init-lsp-mode ()
|
|
|
|
(use-package lsp-mode
|
|
|
|
:config
|
|
|
|
(progn
|
2018-02-19 03:54:15 +00:00
|
|
|
(spacemacs|hide-lighter lsp-mode))))
|
2018-01-21 20:27:33 +00:00
|
|
|
|
|
|
|
(defun lsp/init-lsp-ui ()
|
|
|
|
(use-package lsp-ui
|
2018-02-28 03:29:08 +00:00
|
|
|
:init (add-hook 'lsp-mode-hook #'lsp-ui-mode)
|
2018-01-21 20:27:33 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2018-02-19 03:53:07 +00:00
|
|
|
(spacemacs//lsp-sync-peek-face)
|
|
|
|
(add-hook 'spacemacs-post-theme-change-hook
|
|
|
|
#'spacemacs//lsp-sync-peek-face))))
|