I'm using Visual Studio Code (Version 1.8.1) on Linux. When there is a build error and I click on the line that contains the error it doesn't jump to the corresponding line in the code. Is there a way to make Visual Studio Code behave the same as standard Visual Studio?
-
1Not an answer to the question, but alt-F8 will quickly take you to the next error, at least it does for TypeScript. – Theodore Norvell Apr 09 '19 at 15:33
-
alt-f8 ?? it seem to do something, but 1) alt-f8 is not a keystoke that allows anything 'quickly', since I cant press that left-handed 2) it seems to cycle through 3 of to 6 problems in my case, not sure why – Jan Wilmans Jan 06 '20 at 08:28
4 Answers
Have you defined a problem matcher in your tasks.json
? There are several built-in ones that can simply be referenced, for instance "problemMatcher": ["$tsc"]
will work for TypeScript.
The docs also contain an example for a custom problem matcher for C++:
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
If there's no built-in matcher for the language you're using, you shoulds still be able to find one with a bit of searching if it's moderately popular.

- 31,714
- 9
- 78
- 100
Did you build your code in TERMINAL window of Visual Studio Code? If so, press down the "Ctrl" key and move the mouse cursor to the filename and line number such as "/home/..../xxx.cpp:123" in the error line, then you can click on it to jump to the corresponding line in the code
It works for me.

- 82
- 1
- 1
-
1
-
I didn't know it's better to ask the OP before posting an answer. It was my first time posting an answer. Thank you for reminding me! – fengliutie Sep 11 '17 at 08:18
-
Your welcome. Indeed, your should be certain when you write an answer, otherwise comments are a great place for that. Here is a recap [answer] – tupui Sep 11 '17 at 09:04
-
-
-
Arg, almost works, but ctrl+click highlights the trailing ":" for me (e.g. "concepts.cpp:37:48:") so I have to type RIGHT, BACKSPACE just to remove it and go to file:line:char, which is now 3 actions... – hsandt Jun 16 '20 at 22:06
-
This works for me in 2021 using a vanilla install of VS Code and the MS C++ plugin, after building a simple CMake project by hitting `
` with the default keybinding for that key. – ahcox May 20 '21 at 16:00 -
Shame it's not Jeopardy. It's probably one answer out of a two or three. At least for me it was "the" answer. I think the current C++ plugin as @ahcox mentioned has a default matcher. – David Bradley Oct 22 '22 at 02:21
You can quickly jump to the error in your code by using the shortcut of Ctrl + shift + M

- 51
- 6
-
FYI, Ctrl-M [disables tab](https://stackoverflow.com/questions/35519538/visual-studio-code-tab-key-does-not-insert-a-tab) (yes, the tab key) and the problems list is [ordered by *filename*](https://github.com/microsoft/vscode/issues/98819), so it's not always the first error – jozxyqk Oct 19 '22 at 20:05
Using a vanilla install of Visual Studio Code and the Microsoft C++ plugin, after building a simple CMake project by hitting <F7>
with the default keybinding for that key, <CTRL-LEFT_MOUSE>
works great to navigate to the line of an error from the TERMINAL tab. Note the errors in the OUTPUT window are not clickable.

- 9,349
- 5
- 33
- 38