Comments (15)
@TatriX I have added the function lsp-ui-sideline-toggle-symbols-info
You can do:
;; (require 'lsp-ui)
(define-key lsp-ui-mode-map [f10] 'lsp-ui-sideline-toggle-symbols-info)
from lsp-ui.
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.
from lsp-ui.
@TatriX There is now the face lsp-ui-sideline-global
and the variable lsp-ui-sideline-delay
from lsp-ui.
Allow showing sideline on demand.
It's a cool feature, but can be really noisy. It could be awesome if I could show it for a current line with hotkey.
from lsp-ui.
The origin issue:
emacs-lsp/lsp-mode#194
A lot of the features were mentioned there
from lsp-ui.
https://github.com/cpitclaudel/quick-peek
That might be great for some features. Its not really useful for xref stuff, but for smaller peeks, like C macro expansions etc this would be great
from lsp-ui.
@topisani eventually I’ll get around to integrating cquery with macrostep. Implementation might end up being generic enough to shift it into here.
from lsp-ui.
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 company-childframe
function is from https://github.com/tumashu/company-childframe/blob/master/company-childframe.el
Also the recently added line make the doc non-scrollable
(redirect-frame-focus frame (frame-parent frame))
from lsp-ui.
@fuxialexander Can you test the commit a723db1 ?
from lsp-ui.
@sebastiencs Thanks for the effort. The positioning works, but the content is not scrollable. (caused by (redirect-frame-focus frame (frame-parent frame))
)
Also since sometimes the doc is quite long, I think when display at-point
or even Top/Bottom
, wee should be able to specify the maximum height of the doc.
(set-frame-size frame width (min lsp-ui-doc-max-height height) t)
from lsp-ui.
It would be nice to have the function lsp-ui-peek-dwim
that uses lsp-ui-peek-find-references
if point is on a definition and lsp-ui-peek-find-definitions
otherwise.
from lsp-ui.
Has there been any advancement on a way to quickly toggle / resize the lsp-ui-doc
frame ? It is really not practical to use for Rust, where the doc is very very long :
In this screenshot, the cursor is actually below the frame, so I'd need a quick shortcut to toggle the ui-doc frame if possible
from lsp-ui.
@gagbo did you try lsp-ui-doc-max-width
?
from lsp-ui.
I did not. Am I supposed to change this value each time there's a WM event related to emacs window then ?
from lsp-ui.
Show function name in code snippet in lsp-ui-peek mode if function name is above top line of code snippet.
e.g. I have referenced line 143, and function starts at line 125.
Referenced line shows in the middle of ui-peek window, that's fine.
But function name goes much above top of the window.
And it would be nice to have function definition under the top margin.
from lsp-ui.
Related Issues (20)
- Changing semantic token face category of specific tokens? HOT 1
- doc-render issue in 29 HOT 6
- Long file paths in lsp-ui-peek-find show only prefix HOT 1
- lsp-ui-sideline pop message break line on emacs 29.0.60 HOT 11
- webkit lsp-ui-doc popup not showing up in emacs HOT 1
- lsp-ui-doc overlaps with completion-at-point popup and lsp-ui-doc-position not working
- lsp-ui breaks C-x 1
- lsp-ui-sideline no diagnostics HOT 1
- lsp-ui-doc-hide make emacs not responding unless press a arrow key HOT 2
- lsp-lens crashes, and get wrong-type-argument message HOT 1
- Add HTML space rendering to lsp-ui-doc
- LSP signature when typing function args HOT 2
- lsp-ui-doc-position 'at-point not working on terminal Emacs HOT 1
- code actions shown for entire line instead of only for issue at point HOT 1
- Bug: Warnings "Invalid face reference: lsp-flycheck-info-unnecessary" when using lsp-ui-sideline HOT 1
- Flymake support HOT 1
- Wrong key bindings in LSP UI flycheck <M-return> <return> HOT 1
- Another lsp-ui-doc markdown issue (lists) HOT 2
- lsp-ui-doc uses obsolete variable 'inhibit-point-motion-hooks'
- Show diagnostics for all lines in lsp-ui-sideline HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lsp-ui.