From e91d52629c8c0934c9dfa924ea44aeaebe70097d Mon Sep 17 00:00:00 2001 From: "Mingde (Matthew) Zeng" Date: Tue, 10 Mar 2020 10:46:24 -0400 Subject: [PATCH] Fix: #421 Revert 5ba04fd...9b1b5ce Signed-off-by: Mingde (Matthew) Zeng --- lsp-ui-peek.el | 6 +++++- lsp-ui.el | 19 ++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lsp-ui-peek.el b/lsp-ui-peek.el index 2057fa42..b7012792 100644 --- a/lsp-ui-peek.el +++ b/lsp-ui-peek.el @@ -35,8 +35,8 @@ ;;; Code: (require 'lsp-mode) -(require 'lsp-ui) (require 'xref) +(require 'dash) (defgroup lsp-ui-peek nil "Improve version of xref with peek feature." @@ -718,6 +718,10 @@ Returns item(s)." (unless (bound-and-true-p lsp-ui-mode-map) (user-error "Please load lsp-ui before trying to enable lsp-ui-peek"))) +;; lsp-ui.el loads lsp-ui-peek.el, so we can’t ‘require’ lsp-ui. +;; FIXME: Remove this cyclic dependency. +(declare-function lsp-ui--workspace-path "lsp-ui" (path)) + (declare-function evil-set-jump "ext:evil-jumps.el" (&optional pos)) (provide 'lsp-ui-peek) diff --git a/lsp-ui.el b/lsp-ui.el index 687a9bde..4daecdf7 100644 --- a/lsp-ui.el +++ b/lsp-ui.el @@ -40,9 +40,15 @@ :link '(custom-manual "(lsp-ui) Top") :link '(info-link "(lsp-ui) Customizing")) -(require 'cl-lib) +(require 'lsp-ui-sideline) +(require 'lsp-ui-peek) +(require 'lsp-ui-imenu) +(require 'lsp-ui-doc) (require 'dash) +(with-eval-after-load 'flycheck + (require 'lsp-ui-flycheck)) + (with-eval-after-load 'winum (when (and (boundp 'winum-ignored-buffers-regexp) lsp-ui-doc-winum-ignore) (add-to-list 'winum-ignored-buffers-regexp lsp-ui-doc--buffer-prefix))) @@ -159,15 +165,6 @@ Both should have the form (FILENAME LINE COLUMN)." (cons idx (length refs))) (cons 0 0)))) -(provide 'lsp-ui) - -(cl-eval-when (load eval) - (require 'lsp-ui-sideline) - (require 'lsp-ui-peek) - (require 'lsp-ui-imenu) - (require 'lsp-ui-doc) - - (with-eval-after-load 'flycheck - (require 'lsp-ui-flycheck))) +(provide 'lsp-ui) ;;; lsp-ui.el ends here