我寫了一個problemMatcher在tasks.json看起來像這樣:
"problemMatcher": {
"owner": "myFileExtension",
"pattern": {
"regexp": "myRegExp",
"file": 1,
"line": 2,
"severity": 3,
"message": 4,
"location": 2
}
}
在運行構建任務后,我正在使用此問題匹配器來繪制有問題的行。但是,我想根據問題的實際來源,在特定范圍內繪制曲線,而不是將整條線繪制成波浪線。閱讀檔案后,我仍然不確定如何做到這一點。
我怎樣才能在 中畫出一個范圍tasks.json?
uj5u.com熱心網友回復:
請參閱檔案中的最后一個示例。
位置可以是 1、2 或 4 個數字,包括在 ()
- 1:
(line) - 2:
(line,char) - 4:
(lineStart,charStart,lineEnd,charEnd)
{
"version": "2.0.0",
"tasks": [
{
"label": "watch",
"command": "tsc",
"args": ["--watch"],
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"fileLocation": "relative",
"pattern": {
"regexp": "^([^\\s].*)\\((\\d |\\d ,\\d |\\d ,\\d ,\\d ,\\d )\\):\\s (error|warning|info)\\s (TS\\d )\\s*:\\s*(.*)$",
"file": 1,
"location": 2,
"severity": 3,
"code": 4,
"message": 5
},
"background": {
"activeOnStart": true,
"beginsPattern": "^\\s*\\d{1,2}:\\d{1,2}:\\d{1,2}(?: AM| PM)? - File change detected\\. Starting incremental compilation\\.\\.\\.",
"endsPattern": "^\\s*\\d{1,2}:\\d{1,2}:\\d{1,2}(?: AM| PM)? - Compilation complete\\. Watching for file changes\\."
}
}
}
]
}```
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/382012.html
