LoginSignup
5
11

More than 5 years have passed since last update.

[Visual Studio Code][C/C++] C/C++向けMakefile用tasks.json

Posted at

C/C++向け Makefile 用の tasks.json 設定例です。

実行後は、F8/Shift-F8で次のエラー/前のエラーにジャンプできます。

tasks.json 設定例

tasks.json
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "0.1.0",
    "command": "make",
    "isShellCommand": true,
    "showOutput": "always",
    "suppressTaskName": true,
    "tasks": [
        {
            "taskName": "Makefile",
            "isBuildCommand": true,
            "args": [
                "all"
            ],
            "problemMatcher": {
                "owner": "cpp",
                "fileLocation": [
                    "relative",
                    "${workspaceRoot}"
                ],
                "pattern": {
                    "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
                    "file": 1,
                    "line": 2,
                    "column": 3,
                    "severity": 4,
                    "message": 5
                }
            }
        }
    ]
}

参考

C/C++ extension for Visual Studio Code | Visual C++ Team Blog
.net - Visual Studio jump to next error shortcut? - Stack Overflow

5
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
11