Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show errors/warnings by hotkey in VSCode?

I have to show errors/warnings by mouse now. Is there any hotkey or special button? I could find nothing in "Keyboard Shortcuts". Example of error:

like image 752
Shoshin Nikita Avatar asked Mar 07 '18 07:03

Shoshin Nikita


People also ask

How do I get VS Code to show error?

Right-click on the corresponding entry line and select Show Error Help from the context menu, or click on the hyperlinked error code value in the Code column of the Error List.


2 Answers

The corresponding cmd name in VS Keybindings is editor.action.showHover. On mac for me the key combo was: cmd+k cmd+i. I'm not sure what it is on windows but you can find out through your command palette by typing show hover. It will show you the current keybinding and you can execute it as well.

If you would like you can remap it like this:

{     "key": "ctrl+e",     "command": "editor.action.showHover",     "when": "editorTextFocus" } 

With that, if your cursor is within an error/warning squiggly line, you can hit ctrl+e to show what you would normally see with hover.

To make the box disappear, hit escape.

like image 126
protoEvangelion Avatar answered Oct 03 '22 10:10

protoEvangelion


In case you are using VSCode in vim mode (VSCodeVim extension) move your cursor to the underlined code and type gh.

See https://github.com/VSCodeVim/Vim#-vscodevim-tricks

like image 29
RumTraubeNuss Avatar answered Oct 03 '22 11:10

RumTraubeNuss