Skip to content

Commit

Permalink
lsp: Sync lsp-ui-peek face
Browse files Browse the repository at this point in the history
Theme by 0bl.blwl
  • Loading branch information
MaskRay committed Jan 24, 2018
1 parent 1056a7e commit de5d68f
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 26 deletions.
18 changes: 18 additions & 0 deletions layers/+tools/lsp/funcs.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(defun lsp//sync-peek-face ()
(set-face-attribute 'lsp-ui-peek-list nil
:background (face-attribute 'hl-line :background))
(set-face-attribute 'lsp-ui-peek-peek nil
:background (face-attribute 'hl-line :background))
(set-face-attribute 'lsp-ui-peek-selection nil
:background (face-attribute 'highlight :background)
:foreground (face-attribute 'default :foreground))
(set-face-attribute 'lsp-ui-peek-filename nil
:foreground (face-attribute 'font-lock-constant-face :foreground))
(set-face-attribute 'lsp-ui-peek-highlight nil
:background (face-attribute 'highlight :background)
:foreground (face-attribute 'highlight :foreground)
:distant-foreground (face-attribute 'highlight :foreground))
(set-face-attribute 'lsp-ui-peek-header nil
:background (face-attribute 'highlight :background)
:foreground (face-attribute 'default :foreground))
)
62 changes: 36 additions & 26 deletions layers/+tools/lsp/packages.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(defconst lsp-packages
'(
company-lsp
(company-lsp :requires company)
(helm-xref :requires helm)
(ivy-xref :requires ivy)
lsp-mode
Expand All @@ -21,40 +21,50 @@

(defun lsp/init-helm-xref ()
(use-package helm-xref
:config
;; This is required to make xref-find-references not give a prompt.
;; xref-find-references asks the identifier (which has no text property) and then passes it to lsp-mode, which requires the text property at point to locate the references.
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29619
(setq xref-prompt-for-identifier
'(not xref-find-definitions xref-find-definitions-other-window xref-find-definitions-other-frame xref-find-references spacemacs/jump-to-definition))

;; Use helm-xref to display xref.el results.
(setq xref-show-xrefs-function #'helm-xref-show-xrefs)
))
:defer t
:init
(progn
;; This is required to make xref-find-references not give a prompt.
;; xref-find-references asks the identifier (which has no text property) and then passes it to lsp-mode, which requires the text property at point to locate the references.
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29619
(setq xref-prompt-for-identifier
'(not xref-find-definitions xref-find-definitions-other-window xref-find-definitions-other-frame xref-find-references spacemacs/jump-to-definition))

;; Use helm-xref to display xref.el results.
(setq xref-show-xrefs-function #'helm-xref-show-xrefs)
)))

(defun lsp/init-ivy-xref ()
(use-package ivy-xref
:config
(setq xref-prompt-for-identifier
'(not xref-find-definitions xref-find-definitions-other-window xref-find-definitions-other-frame xref-find-references spacemacs/jump-to-definition))
:defer t
:init
(progn
(setq xref-prompt-for-identifier
'(not xref-find-definitions xref-find-definitions-other-window xref-find-definitions-other-frame xref-find-references spacemacs/jump-to-definition))

;; Use ivy-xref to display xref.el results.
(setq xref-show-xrefs-function #'ivy-xref-show-xrefs)
))
;; Use ivy-xref to display xref.el results.
(setq xref-show-xrefs-function #'ivy-xref-show-xrefs)
)))

(defun lsp/init-lsp-mode ()
(use-package lsp-mode
:config
(require 'lsp-imenu)
(add-hook 'lsp-after-open-hook #'lsp-enable-imenu)
;; Disable lsp-flycheck.el in favor of lsp-ui-flycheck.el
(setq lsp-enable-flycheck nil)
))
(progn
(add-hook 'lsp-mode-hook #'lsp-ui-mode)

(require 'lsp-imenu)
(add-hook 'lsp-after-open-hook #'lsp-enable-imenu)

;; Disable lsp-flycheck.el in favor of lsp-ui-flycheck.el
(setq lsp-enable-flycheck nil)

(spacemacs|diminish lsp-mode "" " L")
)))

(defun lsp/init-lsp-ui ()
(use-package lsp-ui
:after lsp-mode
:after markdown-mode
:config
(add-hook 'lsp-mode-hook #'lsp-ui-mode)
))
(progn
(lsp//sync-peek-face)
(add-hook 'spacemacs-post-theme-change-hook #'lsp//sync-peek-face)
)))

0 comments on commit de5d68f

Please sign in to comment.