Closed dankinsoid closed 1 month ago
Also Error Lens extension could be added to recommended tools
Awesome! I definitely will add problem matchers that you've provided
@hyzyla here is a shortened version:
{
"version": "2.0.0",
"tasks": [
{
"label": "SweetPad: Build",
"type": "sweetpad",
"action": "build",
"group": {
"kind": "build",
"isDefault": true
},
"scheme": "Dev",
"configuration": "Debug",
"options": {
"env": {
"NO_COLOR": "1"
},
},
"problemMatcher": [
{
// Matcher for default problems
"owner": "xcode",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s+(error|warning):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
},
{
// Matcher for xcbeautify errors for any NO_COLOR environment variable
"owner": "xcode",
"fileLocation": "absolute",
"pattern": {
"regexp": "^(?:❌|\\[x\\])\\s*(\\/[^:]+):(\\d+):(\\d+):\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
},
"severity": "error"
},
{
// Matcher for xcbeautify warnings for any NO_COLOR environment variable
"owner": "xcode",
"fileLocation": "absolute",
"pattern": {
"regexp": "^(?:⚠️|\\[!\\])\\s*(\\/[^:]+):(\\d+):(\\d+):\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
},
"severity": "warning"
}
]
}
]
}
@dankinsoid for contributing! The next 0.1.35 version of the extesnion will include such problem matchers:
export const DEFAULT_BUILD_PROBLEM_MATCHERS = [
"$sweetpad-watch",
"$sweetpad-xcodebuild-default",
"$sweetpad-xcbeautify-errors",
"$sweetpad-xcbeautify-warnings",
];
Description
When building iOS projects with the
sweetpad
extension, the errors and warnings fromxcodebuild
only appear in the terminal output. This requires developers to manually search through the terminal for issues, which can slow down the development process.I suggest adding
problemMatchers
to the tasks provided bysweetpad
, which will allow errors and warnings to be parsed and shown in the VSCode "Problems" tab. This would make it easier to identify and navigate to issues in the code.Proposed Solution
I have tested and created the following
problemMatchers
to handle both colorized output fromxcbeautify
and non-colorized output fromxcodebuild
.Here is an example of
sweetpad
build task with working problem matchers: