vscode 自定义任务问题匹配器找不到匹配正则表达式的文本
vscode custom task problem matcher does not find text that matches regex
这是我在 .vscode 目录中的整个 tasks.json 文件
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "make",
"type": "shell",
"command": "make",
"args": [
"all"
],
"group": "build",
"presentation": {
"reveal": "always",
"echo": true,
"showReuseMessage": false,
"clear": true
},
"problemMatcher": [
{
"owner": "ld65-a",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"severity": "error",
"pattern": {
"regexp": "^(Unresolved external)\s+'(.*)'.*:\s+(.*)\((\d.*)\)$",
"file": 3,
"line": 4,
"message": 1,
"code": 2
}
},
{
"owner": "ld65-b",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": {
"regexp": "^ld65:\s+(warning|error|Warning|Error):(.*)\((\d.*)\):\s+(.*)$",
"file": 2,
"line": 3,
"severity": 1,
"message": 4
}
},
{
"owner": "ld65-c",
"fileLocation": "autoDetect",
"pattern": {
"regexp": "^ld65:\s+(warning|error|Warning|Error): (\d+.*)$",
"kind": "file",
"severity": 1,
"message": 2
}
},
{
"owner": "cc65",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": {
"regexp": "^(.*)\((\d.*)\):\s+(warning|error|Warning|Error):\s+(.*)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
}
]
},
{
"label": "clean",
"type": "shell",
"command": "make",
"args": [
"clean"
],
"group": "build",
"presentation": {
"reveal": "always",
"echo": true,
"showReuseMessage": false,
"clear": true
}
}
]
}
这是我正在处理的文本输出的结尾:
cl65 -C src/cmn-src-atarixl-xex.cfg --start-addr 0x4000 -Ln build/bin/cfgame.lbl --ld-args --dbgfile,build/bin/cfgame.dbg --mapfile build/bin/cfgame.map -o build/bin/cfgame.xex build/cf_fileUtils.o build/cf_font.o build/cf_mapEditor.o build/cf_pixmapViewer.o build/cf_tileMap.o build/cf_types.o build/cf_utils.o build/gr7utils.o build/gr12utils.o build/main.o build/pmg.o build/splash.o C:/cc65/lib/atarixl.lib
ld65: Warning: atari/crt0.s(207): 'lowcode area' reaches into 00..FFF bank memory window
Unresolved external '_displaySplashExit' referenced in:
src/main.s(97)
Unresolved external '_selectAppSplash' referenced in:
src/main.s(71)
ld65: Error: 2 unresolved external(s) found - cannot create output file
make: *** [makefile:95: cfgame] Error 1
The terminal process "C:\Program Files\Git\bin\bash.exe '-c', 'make all'" terminated with exit code: 2.
检测到的问题较早出现,但它也确实找到了 '2 个未解决的外部问题。
但是,它没有在输出中找到与 Unresolved external text 相关的特定信息。
我在同一输出上使用 regex101.com 测试了我的正则表达式。我已经尝试了一些变化 - 主要是 json 定义问题匹配器的一些差异。
目标是将未解决的外部项目列为引用实际符号名称的个别问题。
我已经阅读了其他相关的帖子和答案并尝试了不同的东西,因此“所有者”参数被设置为字符串 'ld65-a' 等的原因
我还尝试更改问题匹配器的定义顺序,将未解决的外部匹配器移动到数组中的第一项 - 这似乎无关紧要。
我知道还有其他方法可以 运行 make 任务,但我需要与 gnu make 集成,这似乎是一个合理的方法。
就此而言,也许这里有一个更好的主意-例如运行 gnu make 在我的 vscode 工作区上从应用程序。
Unresolved
匹配器是一个多行问题匹配器
{
"owner": "ld65-a",
"fileLocation": ["relative", "${workspaceFolder}"
],
"severity": "error",
"pattern": [
{
"regexp": "^(Unresolved external)\s+'([^']+)'.*:$",
"message": 1,
"code": 2
},
{
"regexp": "^\s+(.*)\((\d+)\)$",
"file": 1,
"line": 2
}
]
},
这是我在 .vscode 目录中的整个 tasks.json 文件
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "make",
"type": "shell",
"command": "make",
"args": [
"all"
],
"group": "build",
"presentation": {
"reveal": "always",
"echo": true,
"showReuseMessage": false,
"clear": true
},
"problemMatcher": [
{
"owner": "ld65-a",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"severity": "error",
"pattern": {
"regexp": "^(Unresolved external)\s+'(.*)'.*:\s+(.*)\((\d.*)\)$",
"file": 3,
"line": 4,
"message": 1,
"code": 2
}
},
{
"owner": "ld65-b",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": {
"regexp": "^ld65:\s+(warning|error|Warning|Error):(.*)\((\d.*)\):\s+(.*)$",
"file": 2,
"line": 3,
"severity": 1,
"message": 4
}
},
{
"owner": "ld65-c",
"fileLocation": "autoDetect",
"pattern": {
"regexp": "^ld65:\s+(warning|error|Warning|Error): (\d+.*)$",
"kind": "file",
"severity": 1,
"message": 2
}
},
{
"owner": "cc65",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": {
"regexp": "^(.*)\((\d.*)\):\s+(warning|error|Warning|Error):\s+(.*)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
}
]
},
{
"label": "clean",
"type": "shell",
"command": "make",
"args": [
"clean"
],
"group": "build",
"presentation": {
"reveal": "always",
"echo": true,
"showReuseMessage": false,
"clear": true
}
}
]
}
这是我正在处理的文本输出的结尾:
cl65 -C src/cmn-src-atarixl-xex.cfg --start-addr 0x4000 -Ln build/bin/cfgame.lbl --ld-args --dbgfile,build/bin/cfgame.dbg --mapfile build/bin/cfgame.map -o build/bin/cfgame.xex build/cf_fileUtils.o build/cf_font.o build/cf_mapEditor.o build/cf_pixmapViewer.o build/cf_tileMap.o build/cf_types.o build/cf_utils.o build/gr7utils.o build/gr12utils.o build/main.o build/pmg.o build/splash.o C:/cc65/lib/atarixl.lib
ld65: Warning: atari/crt0.s(207): 'lowcode area' reaches into 00..FFF bank memory window
Unresolved external '_displaySplashExit' referenced in:
src/main.s(97)
Unresolved external '_selectAppSplash' referenced in:
src/main.s(71)
ld65: Error: 2 unresolved external(s) found - cannot create output file
make: *** [makefile:95: cfgame] Error 1
The terminal process "C:\Program Files\Git\bin\bash.exe '-c', 'make all'" terminated with exit code: 2.
检测到的问题较早出现,但它也确实找到了 '2 个未解决的外部问题。 但是,它没有在输出中找到与 Unresolved external text 相关的特定信息。 我在同一输出上使用 regex101.com 测试了我的正则表达式。我已经尝试了一些变化 - 主要是 json 定义问题匹配器的一些差异。
目标是将未解决的外部项目列为引用实际符号名称的个别问题。
我已经阅读了其他相关的帖子和答案并尝试了不同的东西,因此“所有者”参数被设置为字符串 'ld65-a' 等的原因
我还尝试更改问题匹配器的定义顺序,将未解决的外部匹配器移动到数组中的第一项 - 这似乎无关紧要。
我知道还有其他方法可以 运行 make 任务,但我需要与 gnu make 集成,这似乎是一个合理的方法。 就此而言,也许这里有一个更好的主意-例如运行 gnu make 在我的 vscode 工作区上从应用程序。
Unresolved
匹配器是一个多行问题匹配器
{
"owner": "ld65-a",
"fileLocation": ["relative", "${workspaceFolder}"
],
"severity": "error",
"pattern": [
{
"regexp": "^(Unresolved external)\s+'([^']+)'.*:$",
"message": 1,
"code": 2
},
{
"regexp": "^\s+(.*)\((\d+)\)$",
"file": 1,
"line": 2
}
]
},