-
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-doc] Show doc at mouse position #493
Conversation
This implementation is different from what we have in dap-mouse.el . We should figure out which one is better. If we decide to go this way, I think that we should somehow unify the mouse handling here and in dap-mouse.el to avoid collisions. We should also take into account: emacs-lsp/dap-mode#348 I also suggest having this enabled by default and require "follow cursor mode" to be enabled explicitly. This suggestion is based on the overall feedback on lsp-ui-doc being too noisy and also based on the fact that vscode has it that way. |
I might be doing something wrong but I am getting this:
|
Thanks, I assumed the server always send range of the hover. Should be fixed with
I agree. What are the requirements for dap-mouse ?
Good point, I will take a look |
It shows hover information for the variable at the point. I think that the collision point is that it should "override" lsp-ui hover when there is an active debug session. I think that this is what makes sense for that case, not sure if there is an alternative. Is this the info you are looking for? |
And one more thing that I would like to have - standardize the sizes of the popups. So, the signature info(see emacs-lsp/lsp-mode#1999), ui doc, dap-mode hovers, etc. should have the same width and eventually the same max height by default. |
Yes ok, make sense.
hmm I'm not sure if it's a good idea, there are symbols where the documentation is just a short word, such as |
Agreed - I tested the vscode equivalent - when it is single liner it shrinks the width. Let's have only this as an exception.
Just want to clarify that I want a fixed minimum size only for width, not for height. So in general, if we decide to enforce minimal width it will hide only one line. |
ATM this is the default behavior: https://preview.redd.it/5tnafm1fk7k51.png?width=1948&format=png&auto=webp&s=818e135578a1d8dc27f748de40cc9dd67bd81e2e and I think this is not fine. |
Following vscode is the right thing to do. What about having the default with the doc showing with the mouse AND with the cursor at the top/bottom right of the frame ?
I agree, the size is not adapted. |
This is a fair point. The whole suggestion with making mouse follow mode the default one is to make lsp-ui mode less intrusive by default.
This will definitely help. IMO we should have smaller defaults no matter what we decide for the rest of the points.
Yes. It always has been about the fact that not enabling feature by default makes the feature undiscoverable. IMO "follow mouse" will be |
cc784e0
to
cdc01a9
Compare
@yyoncho The PR is ready to be merged.
This is handled in the PR, it won't make issue with prefix keys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested and when used in isolation it works fine. I haven't tested how it works in coordination with other mouse related functionalities(dap-mode, flycheck-posframe), etc.
Is there an option to enable only mouse hover?
I added the defcustom And changed some defaults:
I also made some changes with how the frame is focused and scrolled with the mouse. |
Set lsp-ui-doc-position to 'top by default
59de323
to
892241e
Compare
The PR is not ready to be merged yet.
It adds showing the doc at mouse position. If someone is willing to test