Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code C++;VS代码中的自定义问题匹配器未突出显示文件路径 我在VS代码中有一堆自定义构建任务,我希望C++的自定义问题匹配器。_Visual Studio Code_Vscode Problem Matcher - Fatal编程技术网

Visual studio code C++;VS代码中的自定义问题匹配器未突出显示文件路径 我在VS代码中有一堆自定义构建任务,我希望C++的自定义问题匹配器。

Visual studio code C++;VS代码中的自定义问题匹配器未突出显示文件路径 我在VS代码中有一堆自定义构建任务,我希望C++的自定义问题匹配器。,visual-studio-code,vscode-problem-matcher,Visual Studio Code,Vscode Problem Matcher,因此,我决定采用VS Code docs()中的默认问题匹配器示例,并对其进行了轻微修改 "problemMatcher": { "fileLocation": ["relative", "${workspaceFolder}"], "pattern": { "regexp": "^(\\.\\.\\/+)(.*):(\\d+):(\\d+):\\s+(.*):\\s+(.*)$", "file": 2,

因此,我决定采用VS Code docs()中的默认问题匹配器示例,并对其进行了轻微修改

"problemMatcher": {
        "fileLocation": ["relative", "${workspaceFolder}"],
        "pattern": {
          "regexp": "^(\\.\\.\\/+)(.*):(\\d+):(\\d+):\\s+(.*):\\s+(.*)$",
          "file": 2,
          "line": 3,
          "column": 4,
          "severity": 5,
          "message": 6
        }
我的错误消息具有以下结构:

../../../module/src/module/specific/File.cpp:155:31: error: errorMessage
三条目录更新指令(
。/../../
)将我带回
${workspaceFolder}
。因此,我们的想法是使用第二个捕获组作为我的工作区文件夹的相对路径来跟踪文件

不幸的是,文件路径没有突出显示,也没有告诉我按Ctrl+单击来跟随消息。我在上仔细检查了正则表达式,它似乎是正确的。我也尝试使用默认的问题匹配器,但没有任何运气

这是完整构建任务:

{
      "label": "build_c++",
      "type": "shell",
      "command": "${workspaceFolder}/build_command",
      "problemMatcher": [ {
        "fileLocation": ["relative", "${workspaceFolder}"],
        "pattern": {
          "regexp": "^(\\.\\.\\/+)(.*):(\\d+):(\\d+):\\s+(.*):\\s+(.*)$",
          "file": 2,
          "line": 3,
          "column": 4,
          "severity": 5,
          "message": 6
        }
      }],
      "group": {
        "kind": "build",
        "isDefault": true 
      }
},
有什么想法吗