-
-
Notifications
You must be signed in to change notification settings - Fork 345
Using with VSCode
Jarek Zgoda edited this page Apr 24, 2017
·
8 revisions
Visual Studio Code is free (as in "free beer", and they claim the code is Open Source) code editor for Windows, Linux and Mac. While not as sophisticated in C/C++ support as full featured Visual Studio, it already has some official support with C/C++ extension from Microsoft. For easier integration make sure you have both ESP_HOME
and SMING_HOME
exported in your working environment.
- install VS Code, extensions and tools
- clone project skeleton using https://github.com/zgoda/sming-skel.git as source
- remove unwanted bits
- update paths configuration in
${workspaceRoot}/.vscode/c_cpp_properties.json
- should already work out of the box with Linux providing you haveESP_HOME
andSMING_HOME
properly exported
- install VS Code, extensions and tools
- update paths configuration in
${workspaceRoot}/.vscode/c_cpp_properties.json
so the list includes toolchain include path (${ESP_HOME}/xtensa-lx106-elf/xtensa-lx106-elf/include
), Sming framework include paths (${SMING_HOME}
and${SMING_HOME}/system/include
) and possibly your project additional paths (eg.${workspaceRoot}/lib
) - define RunOnSave task to regenerate GNU Global files on every save, eg:
{
"emeraldwalk.runonsave": {
"commands": [
{
"match": "\\.(cpp|h)$",
"isAsync": true,
"cmd": "gtags ${workspaceRoot}"
}
]
}
}
- create file
${workspaceRoot}/.vscode/tasks.json
and define tasks you want to run from command palette, eg:
{
"version": "0.1.0",
"command": "make",
"isShellCommand": true,
"showOutput": "always",
"echoCommand": true,
"suppressTaskName": true,
"tasks": [
{
"taskName": "Build",
"isBuildCommand": true
},
{
"taskName": "Clean",
"args": [
"clean"
]
},
{
"taskName": "Flash",
"args": [
"flash"
]
}
]
}
- add tools and binary artifacts to
.gitignore
, eg:
out
# development tools
.vscode
GTAGS
GRTAGS
GPATH