3030
3131; ;; Code:
3232
33- (require 'lsp-ui-util )
34-
3533(require 'lsp-protocol )
3634(require 'lsp-mode )
3735(require 'dash )
5452(declare-function xwidget-webkit-execute-script-rv " ext:xwidget" (xwidget script &optional default ))
5553(declare-function xwidget-resize " ext:xwidget" (xwidget new-width new-height))
5654
55+ (declare-function lsp-ui-kill-timer 'lsp-ui )
56+ (declare-function lsp-ui-delete-overlay 'lsp-ui )
57+
5758(defgroup lsp-ui-doc nil
5859 " Display informations of the current line."
5960 :group 'tools
6465
6566(defcustom lsp-ui-doc-enable t
6667 " Whether or not to enable lsp-ui-doc.
67- Displays documentation of the symbol at point on hover. This only takes effect when a buffer is started."
68+ Displays documentation of the symbol at point on hover. This only takes effect
69+ when a buffer is started."
6870 :type 'boolean
6971 :group 'lsp-ui )
7072
@@ -181,31 +183,31 @@ Only the `background' is used in this face."
181183 :group 'lsp-ui-doc )
182184
183185(defvar lsp-ui-doc-frame-parameters
184- '((left . -1 )
185- (no-focus-on-map . t )
186- (min-width . 0 )
187- (width . 0 )
188- (min-height . 0 )
189- (height . 0 )
190- (internal-border-width . 1 )
191- (vertical-scroll-bars . nil )
192- (horizontal-scroll-bars . nil )
193- (right-fringe . 0 )
194- (menu-bar-lines . 0 )
195- (tool-bar-lines . 0 )
196- (tab-bar-lines . 0 )
186+ '((left . -1 )
187+ (no-focus-on-map . t )
188+ (min-width . 0 )
189+ (width . 0 )
190+ (min-height . 0 )
191+ (height . 0 )
192+ (internal-border-width . 1 )
193+ (vertical-scroll-bars . nil )
194+ (horizontal-scroll-bars . nil )
195+ (right-fringe . 0 )
196+ (menu-bar-lines . 0 )
197+ (tool-bar-lines . 0 )
198+ (tab-bar-lines . 0 )
197199 (tab-bar-lines-keep-state . 0 )
198- (line-spacing . 0 )
199- (unsplittable . t )
200- (undecorated . t )
201- (top . -1 )
202- (visibility . nil )
203- (mouse-wheel-frame . nil )
204- (no-other-frame . t )
200+ (line-spacing . 0 )
201+ (unsplittable . t )
202+ (undecorated . t )
203+ (top . -1 )
204+ (visibility . nil )
205+ (mouse-wheel-frame . nil )
206+ (no-other-frame . t )
205207 (inhibit-double-buffering . t )
206- (drag-internal-border . t )
207- (no-special-glyphs . t )
208- (desktop-dont-save . t ))
208+ (drag-internal-border . t )
209+ (no-special-glyphs . t )
210+ (desktop-dont-save . t ))
209211 " Frame parameters used to create the frame." )
210212
211213(defvar lsp-ui-doc-render-function nil
@@ -244,6 +246,8 @@ Because some variables are buffer local.")
244246(defvar-local lsp-ui-doc--from-mouse-current nil
245247 " Non nil when the current call is triggered by a mouse event" )
246248
249+ (defvar-local lsp-ui-doc--unfocus-frame-timer nil )
250+
247251(defconst lsp-ui-doc--buffer-prefix " *lsp-ui-doc-" )
248252
249253(defmacro lsp-ui-doc--with-buffer (&rest body )
@@ -422,8 +426,8 @@ We don't extract the string that `lps-line' is already displaying."
422426 " Hide the frame."
423427 (setq lsp-ui-doc--bounds nil
424428 lsp-ui-doc--from-mouse nil )
425- (lsp-ui-util-safe- delete-overlay lsp-ui-doc--inline-ov)
426- (lsp-ui-util-safe- delete-overlay lsp-ui-doc--highlight-ov)
429+ (lsp-ui-delete-overlay lsp-ui-doc--inline-ov)
430+ (lsp-ui-delete-overlay lsp-ui-doc--highlight-ov)
427431 (when-let ((frame (lsp-ui-doc--get-frame)))
428432 (when (frame-visible-p frame)
429433 (make-frame-invisible frame))))
@@ -889,15 +893,15 @@ HEIGHT is the documentation number of lines."
889893 (run-hook-with-args 'lsp-ui-doc-frame-hook frame window)
890894 (when lsp-ui-doc-use-webkit
891895 (define-key (current-global-map ) [xwidget-event]
892- (lambda ()
893- (interactive )
894- (let ((xwidget-event-type (nth 1 last-input-event)))
895- ; ; (when (eq xwidget-event-type 'load-changed)
896- ; ; (lsp-ui-doc--move-frame (lsp-ui-doc--get-frame)))
897- (when (eq xwidget-event-type 'javascript-callback )
898- (let ((proc (nth 3 last-input-event))
899- (arg (nth 4 last-input-event)))
900- (funcall proc arg))))))
896+ (lambda ()
897+ (interactive )
898+ (let ((xwidget-event-type (nth 1 last-input-event)))
899+ ; ; (when (eq xwidget-event-type 'load-changed)
900+ ; ; (lsp-ui-doc--move-frame (lsp-ui-doc--get-frame)))
901+ (when (eq xwidget-event-type 'javascript-callback )
902+ (let ((proc (nth 3 last-input-event))
903+ (arg (nth 4 last-input-event)))
904+ (funcall proc arg))))))
901905 (lsp-ui-doc--webkit-run-xwidget))
902906 frame))
903907
@@ -920,7 +924,7 @@ HEIGHT is the documentation number of lines."
920924 (and (looking-at " [[:graph:]]" ) (cons (point ) (1+ (point ))))))
921925 (unless (equal lsp-ui-doc--bounds bounds)
922926 (lsp-ui-doc--hide-frame)
923- (lsp-ui-util-safe- kill-timer lsp-ui-doc--timer)
927+ (lsp-ui-kill-timer lsp-ui-doc--timer)
924928 (setq lsp-ui-doc--timer
925929 (run-with-idle-timer
926930 lsp-ui-doc-delay nil
@@ -1167,7 +1171,6 @@ It is supposed to be called from `lsp-ui--toggle'"
11671171 (interactive )
11681172 (lsp-ui-doc--hide-frame))
11691173
1170- (defvar-local lsp-ui-doc--unfocus-frame-timer nil )
11711174(defun lsp-ui-doc--glance-hide-frame ()
11721175 " Hook to hide hover information popup for `lsp-ui-doc-glance' ."
11731176 (when (or (overlayp lsp-ui-doc--inline-ov)
0 commit comments