Key combination to scroll through hover text - visual-studio-code

This SO post documents a keyboard shortcut to activate the hover text documentation pop-up in VS Code. However, sometimes the documentation is long enough that you need to be able to scroll through it. Is there a key combination to scroll through the hover text pop-up without using the mouse? (Of course if you activate the hover text using your mouse, then you can scroll through using the scroll wheel on your mouse.)

Related

Prevent VSCode from scrolling up or down when selecting text

When I use VSCode and select text with a mouse (instead of the trackpad) the view is moving up and down slightly. It is annoying. Usually, it only scrolls when the selection is going off screen. Is there a way to turn this off?
It also moves when I place the cursor on new lines.
Editor settings:

Is there a way to dismiss hover window (the tooltip like thingy) when I press any key?

In typescript project I hover the mouse over types to find what it contains. Then pressing any key dismisses it.
However when I bring the same tooltip via keyboard, it does not dismiss untill I press escape.
Is there some settings to auto dismiss the tooltip when it is invoked by the keyboard ?
This will help a smooth learn and edit experience

Access mouse over hover in VSCode

Is there a way to access the mouse over popup in VSCode via Keyboard and navigate in it?
I often use the mouse over to get the namespace of function or variable ...
So I want to place the cursor on "bar", popup the hover (Show Hover Ctrl+k Ctrl+i), focus it, mark some text (eg. namespace::functioname), copy and close the hover.
namespace foo{
void bar();
}
First problem, the hover doesn't get the focus and I don't know how to focus it. But there is another feature "Show defintion preview hover", which actually gets focused. So far so good. But I still cannot mark or copy text inside the hover via keyboard.
Show hover (not focused):
Show definition preview hover (focused):
But I still cannot mark or copy text inside the hover via keyboard.
That should change with VSCode 1.68 (May 2022):
Lock hovers to more easily mouse over them
Some custom hovers cannot be moused over and others are tricky to mouse over without hiding it because of other things in the way (eg. like a scroll bar).
Holding alt while a hover is active will now "lock" it, giving it a wider border and preventing moving the mouse outside of the hover widget or whatever triggered it from hiding it.
This is primarily an accessibility feature to make hovers play nice with screen magnifiers but it is also useful for copying text from certain hovers.
Note that this feature only applies outside of the editor because editor hovers can always be moused over unless specified otherwise via a setting.
This will be helpful for other views (debug, terminal, ...) where variables with their popup can appear as well.
In the editor, see microsoft/vscode issue 63296
ctrl+K ctrl+I to show the hover and focus it
ctrl+A to select all the hover content
ctrl+C to copy to clipboard
It does indeed work for me (on windows) for the first two steps, however ctrl+C does not copy the text selected with ctrl+A.
It seems like there are two different selections possible in the hover:
ctrl+Aselects everything with a dark blue.
When selecting some text in the hover with the mouse (i.e. press the left mouse button while near/over a char, move mouse, release left mouse button) the selected text is shown in a lighter and brighter blue.
The two selections can coexist.
ctrl+C always copies the text selected with the mouse, or nothing if there's no such selection, no matter whether a ctrl+A selection also has been done.
If there's only a ctrl+A selection, ctrl+C doesn't copy anything.
The two selections can be selected in any order. The order doesn't change the behavior.
Think I found out what you were after.
The shortcut is: Ctrl+K Ctrl+I
See: Trigger advanced hover information with keyboard
please try control + mouse click
it may be help you

Page down/up when clicking in the VSCode scrollbar

Is there a setting to change the click behavior in the scrollbar to page up/down instead of jumping to the location in the file? This is the usual scrollbar behavior in almost every other applications except maybe unix applications.
A suggestion could be:
Left click: page up/down
Right click: jump to location
There is a setting for this now:
Editor: Scroll by Page
Controls whether clicks scrolls by page or
jumps to click position.
With that setting enabled, the editor will scroll by one viewport page when clicking anywhere above or below the scrollThumb. With it not enabled (the default) it will scroll to the position in the scroll track where you clicked.
This behavior does not currently exist. I suggest opening a feature request on github.
If, like me, you've been brought to this page despite putting "Visual Studio" into your web search, you can modify this behaviour in the full blown Visual Studio as follows:
Tools > Options > Text Editor > All Languages > Scroll Bars
Under "Behavior", toggle between bar mode and map mode
More information can be found by reading the Microsoft Docs for this feature.

JFace: Resizable tooltip with ColumnViewerToolTipSupport

Can anyone show me how to use org.eclipse.jface.viewers.ColumnViewerToolTipSupport to create a tooltip similar to the one shown in Eclipse IDE when you hover your mouse to any Java element? That is, I want the tooltip to be resizable, I also want to hook an F2 key to show the tooltip on demand in addition to mouse hover.
I have managed to add my own custom control to the tooltip (a TableViewer), but I can't see any methods/ways to set the tooltip to be resizable and only dissappear when user clicks on a key (e.g. esc key). Is this even possible with ColumnViewerToolTipSupport?
I have used as my reference an example at http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet037FancyCustomTooltips.java?view=markup
Thanks.
The window appearing in Eclipse when you hover mouse pointer over a Java element is not a tooltip, but InformationControl. See org.eclipse.jface.text.AbstractInformationControlManager.install(Control) for more information.
I don't think it will work right away with table cells, so you probably will have to combine some ColumnViewerToolTipSupport techniques with it.
Cheers,
Max