visual-studio-code - vscode problemMatcher 无法识别任务编译器警告
问题描述
以下 Tasks.json 问题匹配器正则表达式应匹配以下典型警告。但事实并非如此。ctc W505:[“somedirectory/somefile.c”350/18] 隐式声明等等等等
问题是什么?我验证了内置解析器匹配 gcc 输出错误和警告。
谢谢,
萨蒂什·K
"tasks": [
{
"label": "build.bat",
"type": "shell",
"command": "build.bat",
"problemMatcher": {
"owner": "cpptools",
"fileLocation": [
"relative",
"${env:PWD}"
],
"pattern": {
"regexp": "^ctc W(\\d+): \\[\\\"(.*)\\\" (\\d+)\\\/(\\d+)\\] (.*)$",
"file": 2,
"line": 3,
"column": 4,
"message": 5
}
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
解决方案
我无法让它工作。但是我通过 json escpare 运行了工作 regex101。它做了更多的斜线转义,结果如下:
"regexp": "^ctc W(\\d+): \\[\\\"(.*)\\\" (\\d+)\\/(\\d+)\\] (.*)$",
推荐阅读
- android - 检测应用何时进入自由窗口模式
- amazon-cloudformation - 如何在 AWS CDK 中引用 `elasticsearch.CfnDomain` 生成的域名?
- arrays - 我的函数快速返回空数组并解析
- java - Java:getter 或零参数方法的功能链接
- javascript - 我想导航到另一个 html 中的特定 div。为什么这段代码不起作用?
- scala - Spark - Add a column which sums another column, grouped by a third column, without losing other columns
- c# - 如何将combobox1项目从form1传递到form2中的combobox2
- c# - CommandLineParser:获取互斥选项集的名称
- android-studio - 让 Android 模拟器在 Ubuntu 20.04 上保持领先
- javascript - 我可以在 ScrollTrigger 中使用跨度而不是 div 吗?