I have fully switched to VSCode for doing Particle development.
Having all the login and device selection in Atom was nice, but the error parser never worked and the lack of control+click for jump-to-definition forced the switch.
To get the error parser working for Particle cloud build in VSCode, I extended the script from the original source in this post. There was a pretty odd thing where āworkspaceā would be prepended to paths when errors were reported, and youāll see it removed with the error parser regex.
Works on OSX. Untested on other platforms. Be sure to install the C/C++ extension. Error parsing isnāt always perfect, but it pretty much works and it is very nice to have. Use of a .ino file will not work, since it gets internally renamed to .cpp upon compile.
Hereās my tasks.json:
//tasks.json for Particle online build
{
"version": "0.1.0",
"command": "particle",
"isShellCommand": true,
"args": [],
"showOutput": "always",
"echoCommand": true,
"tasks": [
{
"taskName": "compile",
"suppressTaskName": false,
"isBuildCommand": true,
"args": ["electron","${workspaceRoot}", "--saveTo", "${workspaceRoot}/firmware.bin"],
// Use the standard less compilation problem matcher.
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(/workspace|/worksapce/)(.*?):(\\d+):(\\d+):\\s+(warning|error|fatal error):\\s+(.*)$",
"file": 2,
"line": 3,
"column": 4,
"severity": 5,
"message": 6
},
"severity":"error"
}
},
{
"taskName": "flash",
"suppressTaskName": false,
"isTestCommand": true,
"args": ["--usb", "firmware.bin"]
}
]
}