vscode自定义任务问题匹配器找不到与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 $4000..$7FFF 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 FilesGitbinbash.exe '-c', 'make all'" terminated with exit code: 2.

检测到的问题出现得更早,但它也发现了"2个未解决的外部"。但是,它在输出中找不到与未解析的外部文本相关的特定信息。我在同一个输出上使用regex101.com测试了我的regex。我已经尝试了一些变体——主要是在定义问题匹配器的json中的一些差异。

目标是将未解决的外部项目列为引用实际符号名称的单个问题。

我已经通读了其他帖子&答案涉及并尝试了不同的事情,因此;所有者;参数已设置为字符串"ld65-a"等。

我还尝试更改问题匹配器的定义顺序,将未解决的外部匹配器移动到数组中的第一个项——这似乎无关紧要。

我意识到还有其他方法可以运行make任务,但我需要与gnu-make集成,这似乎是一种合理的方法。也许在这方面有一个更好的想法——例如,从应用程序在我的vscode工作区上运行gnu make。

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
}
]
},

最新更新