show documentation on hover
Hi
I had phpstorm set up nicely
For reasons I will not go into my settings got deleted and I am trying to remember how I set it up.
Previously when I hovered over a definition I got a popup with the elements doc block displayed.
Please tell me how to enable this.
Thanks
请先登录再写评论。
Hi there,
Settings/Preferences | Editor | Code Editing --> Show quick documentation on mouse move
How do I show the quick documentation by mouse cursor hover + button press? Like hover over a function or class name then hold Alt or Ctrl or something like that.
I still want to see the documentation reference on demand, just not automatically.
@Davitu
There is no such option. I mean, when it's automatic. Unless you manually invoke it (using "View | Quick Documentation" shortcut).
The best I can offer: hit the shortcut for the "View | Quick Documentation" 2 times in a row -- this will pin the documentation (or use "Open as Tool Window" from popup menu). You can now dock it as any other toolwindow to any side (bottom/left/right) so it's always there. It will now automatically display docs for whatever element is under the cursor (after a short delay or on manual invocation). At very least it's located in the fixed position and not popping out over your code at inappropriate moments.
P.S. I did ask to have it on hover when Ctrl is pressed in the original ticket back then in 2012 (https://youtrack.jetbrains.com/issue/IDEA-66333#focus=Comments-27-358746.0-0) .. but it was lost/ignored/treated as "not essential"
Perhaps you can find some existing ticket for that: https://youtrack.jetbrains.com/issues/IDEA?q=%22quick%20documentation%22
Please try the "Ctrl+Q" shortcut, that should to the trick.
I noticed that clicking View shows that Quick Documentation's keyboard shortcut is Ctrl+Shift+Space, and that when clicking on a method and using that shortcut, it will pop up what I saw happening automatically on hover previously.
So this is the on-demand method I'm looking for. I know Andriy was trying to describe this, but didn't mention that the property needs to be clicked on first, which I just realized today.
The pin feature is nice.
It would be perfect to not have to click on the property (losing any click context I'm already in, which could be unrelated to Quick Documentation context).
PHPStorm already has a hover + Ctrl event which underlines the property and turns it blue, then where clicking it will take me to the definition or its usages; and I think Mac Option or Command - or some other keyboard combination of Ctrl, Command, Option, Alt, etc - has some hover events.
So JetBrains could tie one or more of these buttons to a hover event to show Quick Documentation on demand more easily than requiring an initial click to place the caret on the property... which would be very useful.
>It would be perfect to not have to click on the property (losing any click context I'm already in, which could be unrelated to Quick Documentation context).
When Quick Documentation is pinned and "on hover" is enabled then it will update doc to whatever element is under cursor -- you do not have to click on it.
Proof (line with yellow background -- that's where caret is; Quick Documentation is pinned to the right side): https://recordit.co/0b6HVFlXhC
P.S. You can have automatic Quick Documentation when using Code Completion .. but that's a different option. Ctrl+Shift+Space is one of the Code Completion popups (at very least here on Windows using default Keymap).
> When Quick Documentation is pinned and "on hover" is enabled then it will update doc to whatever element is under cursor -- you do not have to click on it.
By "on hover" I'm assuming you mean the toggle in the Quick Documentation pinned panel named "Show on mouse move":
Having this enabled does auto-update the panel, which is nice.
What would be nicer than requiring a panel is just hovering on a property then hitting one or more passive keys (Ctrl, Shift, Alt, Command, Option) to have the pop-up show (the way it does by default without passive key press).
Your ticket to have this - https://youtrack.jetbrains.com/issue/IDEA-66333#focus=Comments-27-358746.0-0 - I think is the same thing I'd like.
I mean, technically it's non-essential... to the functionality of the editor letting me edit code... but so is syntax highlighting and indexing for Ctrl+click tracing... but in this case, they seem of equivalent importance, because an unintended pop-up over code is obtrusive and happens often accidentally (while just resting the mouse wherever), and a hover+click for Quick Documentation is probably more useful (so to me, more essential) than a Ctrl+click to go to the property's definition (which will move your caret or open another file).
Could I ever be wrong here? JetBrains doesn't see it our way; a hover+click that could just manually show a pop-up of the declaration info as opposed to going to the declaration... would save us time. But they consider it less essential than an existing feature that is more involved to use.
>and Quick Documentation updates in your video only after the property is selected (which is different than just hover).
As you may clearly see from the video my caret remains on line #13 (the line with yellow background). All changes in Quick Documentation panel once it's pinned is done on hover. Make sure that the "on hover" option is enabled.
Here is new video with more visible mouse cursor + PhpStorm window has focus (last time the focus was left in the recording software window). Once again: the caret remains on line #13 so no clicks here, only hover over. The caret remains on the same position (it's visible here now).
https://recordit.co/LrsWSy23q8
>That's what I was saying.
Yes, I know what you want. But it's not available. Feel free to create a new ticket for devs to review it. If they will find some existing one -- no problems, it will just show that there is a demand for this.
Andriy I think you may have replied to my previous reply which I deleted after I understood your "on hover" comment referred to the "Show on Mouse Move" toggle in the pinned Quick Documentation panel; I posted a new reply.
I now notice that after having enabled "Show on Mouse Move" and closing the panel, it will open up again on any hover of any property... which is even worse than a hover pop-up. So this is not something I can feasibly have enabled all the time. Having to toggle it often is more annoying than an unwanted hover pop-up.
Having the panel open is really only useful if I want to browse multiple property definitions within a short time period, which I don't need to do often.
Anyway, I only said "That's what I was saying" because your description was basically what I was looking for but wasn't specific enough to what I found based on your description, due to terminology not being specific enough. I'm using "Show on Mouse Move" toggle terminology as opposed to generic "on hover" when referring to that just for clarity's sake here, as it's easy to get confused otherwise as I did.
Thanks for the help. It did clarify this for me. I think we both want a hover+click option to have the Quick Documentation pop-ups show rather than a pinned panel and a toggle button, but I just don't understand why JetBrains sees this as less essential than the existing feature of hover+click to go to the definition, which is more disruptive and probably shows more info than you'd need compared to Quick Documentation.
I consider our request to be more essential, because it's easier and more effective. I'm not sure how to convince JetBrains of this however.
This is there in IntelliJ and kind of sucks. The settings don't turn it off. Perhaps that's a bug. Personally I don't want this feature. Previously I could hold ctrl or command on mac and move the mouse to the method highlighted before I clicked. Now I can't. Perhaps not changing the original way would have been a better approach, but rather adding it with ctrl/cmmand + shift + click or whatever mapping is open. Now I have to hover and ensure without visual aide that I am on the thing of interest before I press the ctrl/command key but after the click. It would be awesome if this was fixed. It slows me down.
Works fine for me: If I untick that option PhpStorm will not show doc popup on hover.