-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lsp-ui feature wishlist #1
Comments
The origin issue: |
https://github.com/cpitclaudel/quick-peek |
@TatriX I have added the function You can do: ;; (require 'lsp-ui)
(define-key lsp-ui-mode-map [f10] 'lsp-ui-sideline-toggle-symbols-info) |
Cool, thank you! Another 2 features I was thinking about: allow customization of the sideline bg color (not sure if it's possible though) and customize delay before showing the sideline. It's the same as with completion: if I know what I'm doing I just type my code and don't see the completion. But if I'm stuck, I can wait half a second and see a completion or sideline. Of course I'm not sure it will be actually useful. |
@TatriX There is now the face |
Similar to vscode, I think we should be able to show lsp-ui-doc at the point (defun lsp-ui-doc--move-frame (frame)
"Place our FRAME on screen."
(lsp-ui-doc--resize-buffer)
(-let* (((_left top right _bottom) (window-edges nil nil nil t))
(window (frame-root-window frame))
((width . height) (window-text-pixel-size window nil nil 10000 10000))
(width (+ width (* (frame-char-width frame) 2))) ;; margins
(frame-resize-pixelwise t)
(x-and-y (company-childframe-compute-pixel-position
(- (point) 1)
(frame-pixel-width frame)
(frame-pixel-height frame))))
(set-window-margins window 1 1)
(set-frame-size frame width (min 300 height) t)
(set-frame-position frame (car x-and-y) (+ (cdr x-and-y) 1))))
(defun company-childframe-compute-pixel-position (pos tooltip-width tooltip-height)
"Return bottom-left-corner pixel position of POS in WINDOW.
its returned value is like (X . Y)
If TOOLTIP-WIDTH and TOOLTIP-HEIGHT are given, this function will use
two values to adjust its output position, make sure the *tooltip* at
position not disappear by sticking out of the display."
(let* ((window (selected-window))
(frame (window-frame window))
(xmax (frame-pixel-width frame))
(ymax (frame-pixel-height frame))
(header-line-height (window-header-line-height window))
(posn-top-left (posn-at-point pos window))
(x (+ (car (window-inside-pixel-edges window))
(or (car (posn-x-y posn-top-left)) 0)))
(y-top (+ (cadr (window-pixel-edges window))
header-line-height
(or (cdr (posn-x-y posn-top-left)) 0)))
(font-height
(if (= pos 1)
(default-line-height)
(aref (font-info
(font-at
(if (and (= pos (point-max))) (- pos 1) pos)))
3)))
(y-buttom (+ y-top font-height)))
(cons (max 0 (min x (- xmax (or tooltip-width 0))))
(max 0 (if (> (+ y-buttom (or tooltip-height 0)) ymax)
(- y-top (or tooltip-height 0))
y-buttom))))) The Also the recently added line make the doc non-scrollable (redirect-frame-focus frame (frame-parent frame)) |
With a new choice with lsp-ui-doc-position: at-point
@fuxialexander Can you test the commit a723db1 ? |
@sebastiencs Thanks for the effort. The positioning works, but the content is not scrollable. (caused by Also since sometimes the doc is quite long, I think when display (set-frame-size frame width (min lsp-ui-doc-max-height height) t) |
It would be nice to have the function |
@gagbo did you try |
I did not. Am I supposed to change this value each time there's a WM event related to emacs window then ? |
Show function name in code snippet in lsp-ui-peek mode if function name is above top line of code snippet. |
No description provided.
The text was updated successfully, but these errors were encountered: