How to trigger parameter hints in Visual Studio Code? - visual-studio-code

I want to show parameter hints when I position cursor within the parentheses of the calling method.
Note: I know similar answers already exist for Visual Studio on Reddit, but I couldn't find a quick answer for this question on Stack Overflow. So I've decided to add it.

For Windows and Linux:
Ctrl + Shift + Space
For MacOS:
Shift ⇧ + Cmd ⌘ + Space

Update v1.6 - Aug 2021
There's also a new feature called inlay hints which you can enable in your settings.json like this:
"javascript.inlayHints.parameterNames.enabled": "all",

For Java extension, ctrl+shift+space works only after setting Java > Signature Help: Enabled in your settings.json:

Code -> Preferences -> Keyboard Shortcuts
Search for "Trigger parameter hints"
Here you can either inspect the defined shortcut
Or you can change keybinding by pressing to the left of "Trigger parameter hints" command name.

Method1
cntrl+shift+space
Method2
View -> Command Palette->parameter hints
Method3
hover mouse on the function.then it will show the hint.
If you feel gif is too small click on the gif it will expand.

You can use Ctrl+Space to show parameter hints before parentheses, and if you want to trigger parameter hints in parentheses to know about arguments you can use Ctrl+Shift+Space

If like me you always forget, open the palette, the shortcut will be displayed:

Related

VS code method documentation tooltip keyboard shortcut [duplicate]

I want to show parameter hints when I position cursor within the parentheses of the calling method.
Note: I know similar answers already exist for Visual Studio on Reddit, but I couldn't find a quick answer for this question on Stack Overflow. So I've decided to add it.
For Windows and Linux:
Ctrl + Shift + Space
For MacOS:
Shift ⇧ + Cmd ⌘ + Space
Update v1.6 - Aug 2021
There's also a new feature called inlay hints which you can enable in your settings.json like this:
"javascript.inlayHints.parameterNames.enabled": "all",
For Java extension, ctrl+shift+space works only after setting Java > Signature Help: Enabled in your settings.json:
Code -> Preferences -> Keyboard Shortcuts
Search for "Trigger parameter hints"
Here you can either inspect the defined shortcut
Or you can change keybinding by pressing to the left of "Trigger parameter hints" command name.
Method1
cntrl+shift+space
Method2
View -> Command Palette->parameter hints
Method3
hover mouse on the function.then it will show the hint.
If you feel gif is too small click on the gif it will expand.
You can use Ctrl+Space to show parameter hints before parentheses, and if you want to trigger parameter hints in parentheses to know about arguments you can use Ctrl+Shift+Space
If like me you always forget, open the palette, the shortcut will be displayed:

How can I force the function documentation popup to show when editing an invocation in VS Code? [duplicate]

I want to show parameter hints when I position cursor within the parentheses of the calling method.
Note: I know similar answers already exist for Visual Studio on Reddit, but I couldn't find a quick answer for this question on Stack Overflow. So I've decided to add it.
For Windows and Linux:
Ctrl + Shift + Space
For MacOS:
Shift ⇧ + Cmd ⌘ + Space
Update v1.6 - Aug 2021
There's also a new feature called inlay hints which you can enable in your settings.json like this:
"javascript.inlayHints.parameterNames.enabled": "all",
For Java extension, ctrl+shift+space works only after setting Java > Signature Help: Enabled in your settings.json:
Code -> Preferences -> Keyboard Shortcuts
Search for "Trigger parameter hints"
Here you can either inspect the defined shortcut
Or you can change keybinding by pressing to the left of "Trigger parameter hints" command name.
Method1
cntrl+shift+space
Method2
View -> Command Palette->parameter hints
Method3
hover mouse on the function.then it will show the hint.
If you feel gif is too small click on the gif it will expand.
You can use Ctrl+Space to show parameter hints before parentheses, and if you want to trigger parameter hints in parentheses to know about arguments you can use Ctrl+Shift+Space
If like me you always forget, open the palette, the shortcut will be displayed:

How do I select a block of code in VSCode using only the keyboard?

What is the best way to select a block of code in VSCode?
Is there any shortCut, which we can use?
You've probably got this by now, but what you need to do is search the Keyboard Shortcuts for the shift+alt+arrow mappings, and swap the cursorColumnSelect commands (currently mapped to ctrl+shift+alt+arrow) with the commands that are currently mapped to the desired keys.
Depends on the language, it was already asked btw.
Check this, works with HTML and JS
Also pressing Ctrl + I + up/down arrow will select the whole next line.
You can press SHIFT and select code with arrow keys.

How to trigger documentation popup in vscode

How to trigger a popup with documentation for identifier under the cursor?
Normally it appears when hovering the identifier using the mouse pointer:
I would like to achieve this effect using a command or keyboard shortcut.
The only related commands I found are: trigger completion (which doesn't show the function doc) and trigger parameters hint (which only works when the cursor is inside function call - parameters list).
This is the editor.action.showHover command. It is bound to cmdk cmdi by default.
Note: Shortcut works by holding down the cmd [ctrl in windows], then while holding press k then i
You can change the keyboard shortcut with a keybinding such as:
{
"key": "cmd+k ctrl+space",
"command": "editor.action.showHover",
"when": "editorTextFocus"
}
The default shortcut for Trigger Parameter Hints is Ctrl+Shift+Space
You also have, with VSCode 1.40 (Oct. 2019):
Definition Preview Hover from the keyboard
There is a new command Show Definition Preview Hover for better accessibility of the definition preview hover widget, which can be triggered by hovering a symbol with the mouse and pressing a modifier key dependent on the platform and configuration.
Previously, only the command Show Hover was provided, which is equivalent to hovering the mouse cursor over a symbol.
Now, with Show Definition Preview Hover, the detailed hover information can be shown via the keyboard.
To make this more graphic, check these steps:
In Visual Studio 2019 for Mac, I couldn't find anything about "hover" in the Key Bindings setting. The relevant command seems to be called "Show quick info" and is bound by default to Cmd + F1.
I know this question is about VSCode but I could only find this question when trying to search for an answer. Therefore I would also like to leave the information here in case somebody finds it useful.
There are multiple ways to trigger the documentation popup:
First: Using shortcut ctrl + space
Second: Using vscode extension:
Here is the documentation:
Each answer here demonstrates a different function. Below is a consolidation of every type of helpful popup, the context in which they come up and all the ways I know to trigger them.
These assume default settings.
Function: Display documentation
Shortcut: Ctrlk Ctrli
Scope: Works over named elements - variable and function names (does nothing over literals).
Can display function documentation:
or variable or even property information:
This is the same pop-up you get when you hover over the element briefly.
Function: Display parameter hints.
Shortcut: CtrlShiftSpace
Scope: Works inside a function call.
The cursor must be inside the parenthesis that contain the passed arguments. Does nothing outside that scope.
Can also be triggered by typing a comma, as if passing another argument.
Up/Down arrows can be used to cycle through overloaded definitions (instead of moving the cursor up and down the document).
Function: Display the code completion menu
Shortcut: CtrlSpace
Scope: Anywhere. Will adapt to the context. In strings will display words only. In code will offer symbol hints - function names, variable names within the current scope, known properties, etc.
Is case insensitive.
Matches all contained characters - they do not have to be consecutive (see image above).
Tab or Enter accepts the currently selected suggestion.
Symbol hints can be triggered by just typing letters. Inside strings you must use the keyboard shortcut.

Eclipse's Ctrl+1 in IntelliJ and Android Studio

I really like the Ctrl+1 shortcut (hints for errors and mini refactorings) in Eclipse. Is there an equivalent for it in IntelliJ and Android Studio?
Alt+Enter
Personally I don't think AltEnter is particularly correct. Ctrl1 does lots of code generation like generating local variables given a method call etc.
CtrlAltV ... generates a local variable
CtrlAltF ... generate a field
AltInsert ... generate (drop down menu to generate all sorts)
Now, unrelated to the question but maybe helpful and in the same ball park is that the "foreach" short cut in IntelliJ is iter rather than for.
I also don't think ctrl+enter is the answer.
I'd say ctrl+alt+shift+t (Refactor this...) which I remapped to ctrl+1 is the closest thing to ctrl+1 from eclipse. It allows you to inline, extract code (variable, method, field etc.), move code, pull members etc.
Ctrl + 1 was one of my favorite shortcuts but unfortunately there is no exact equivalent shortcut for that. You can search for Quick fix in: File-->Settings-->Keymap, but you'll find nothing.
Although many people would say Alt + Enter is the nearest answer. but I think there are better equivalents such as Ctrl+Alt+Shift+t. It will give you some magic options.
You can also remap it to Ctrl + 1 by going to:
File-->Settings-->Keymap
Try pressing CTRL + ALT + v.
It will give the return type exactly of that method.
I think the "Other -> Show Context Actions" is very close to Ctrl+1 in Eclipse.