Skip to content

Commit eba9c4e

Browse files
authored
Revert (#708)
1 parent 5dc0b09 commit eba9c4e

File tree

1 file changed

+15
-45
lines changed

1 file changed

+15
-45
lines changed

lsp-ui.el

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -34,52 +34,8 @@
3434
;;; Code:
3535

3636
(require 'dash)
37-
(require 'find-func)
38-
(require 'face-remap)
39-
4037
(require 'lsp-protocol)
41-
42-
;;
43-
;;; Util
44-
45-
(defmacro lsp-ui--mute-apply (&rest body)
46-
"Execute BODY without message."
47-
(declare (indent 0) (debug t))
48-
`(let (message-log-max)
49-
(with-temp-message (or (current-message) nil)
50-
(let ((inhibit-message t)) ,@body))))
51-
52-
(defmacro lsp-ui--with-no-redisplay (&rest body)
53-
"Execute BODY without any redisplay execution."
54-
(declare (indent 0) (debug t))
55-
`(let ((inhibit-redisplay t)
56-
(inhibit-modification-hooks t)
57-
(inhibit-point-motion-hooks t)
58-
buffer-list-update-hook
59-
display-buffer-alist
60-
window-configuration-change-hook
61-
after-focus-change-function)
62-
,@body))
63-
64-
(defun lsp-ui-kill-timer (timer)
65-
"Safely kill the TIMER."
66-
(when (timerp timer) (cancel-timer timer)))
67-
68-
(defun lsp-ui-delete-overlay (overlay)
69-
"Safely delete the OVERLAY."
70-
(when (overlayp overlay) (delete-overlay overlay)))
71-
72-
(defun lsp-ui-line-number-display-width ()
73-
"Safe way to get value from function `line-number-display-width'."
74-
(if (bound-and-true-p display-line-numbers-mode)
75-
;; For some reason, function `line-number-display-width' gave
76-
;; us error `args-out-of-range' even we do not pass anything towards
77-
;; to it function. See the following links,
78-
;;
79-
;; - https://github.com/emacs-lsp/lsp-ui/issues/294
80-
;; - https://github.com/emacs-lsp/lsp-ui/issues/533 (duplicate)
81-
(+ (or (ignore-errors (line-number-display-width)) 0) 2)
82-
0))
38+
(require 'find-func)
8339

8440
(defconst lsp-ui-resources-dir
8541
(--> (or load-file-name (buffer-file-name))
@@ -89,6 +45,11 @@
8945
(and (file-directory-p it) it))
9046
"Resource folder for package `lsp-ui'.")
9147

48+
(require 'lsp-ui-sideline)
49+
(require 'lsp-ui-peek)
50+
(require 'lsp-ui-imenu)
51+
(require 'lsp-ui-doc)
52+
9253
(defgroup lsp-ui nil
9354
"‘lsp-ui’ contains a series of useful UI integrations for ‘lsp-mode’."
9455
:group 'tools
@@ -103,6 +64,14 @@
10364
(when (and (boundp 'winum-ignored-buffers-regexp) lsp-ui-doc-winum-ignore)
10465
(add-to-list 'winum-ignored-buffers-regexp lsp-ui-doc--buffer-prefix)))
10566

67+
(defun lsp-ui-peek--render (major string)
68+
(with-temp-buffer
69+
(insert string)
70+
(delay-mode-hooks
71+
(let ((inhibit-message t)) (funcall major))
72+
(ignore-errors (font-lock-ensure)))
73+
(buffer-string)))
74+
10675
(defun lsp-ui--workspace-path (path)
10776
"Return the PATH relative to the workspace.
10877
If the PATH is not in the workspace, it returns the original PATH."
@@ -203,5 +172,6 @@ Both should have the form (FILENAME LINE COLUMN)."
203172
(cons idx (length refs)))
204173
(cons 0 0))))
205174

175+
206176
(provide 'lsp-ui)
207177
;;; lsp-ui.el ends here

0 commit comments

Comments
 (0)