VSCode Integration
Infuse-IoT implements extension west commands to automatically generate VSCode configuration files for development and debugging.
Editor Configuration
Generating a basic configuration file for Infuse-IoT applications is done with the following command:
west vscode
Warning
This command overwrites any previous content in the listed files.
This generates the following files:
settings.json
Automatic code formatting:
c:
clang-format
python:
ruff
Indentation settings for
cmake
,c
,dts
andkconfig
files
Searching inside VSCode can sometimes be frustrating due to the duplication of files
by build and test commands. This results in multiple copies of the same file existing in different
locations, cluttering the search results. Common build paths can be excluded from the
search results by appending the --search-exclude
option to west vscode
.
Note
The default west build
output directory (build
) is not excluded from search results
due to the presence of useful autogenerated files such as zephyr.dts
, devicetree_generated.h
and more.
extensions.json
Recommended extensions for working with Zephyr, CMake and C projects.
snippets.json
Quick generation of new file prefixes for .c
and .h
headers through typing
new_file_c
or new_file_h
in a file.
Application Configuration
Once an application has been built, Infuse-IoT can generate application specific configuration files for Intellisense and debugging:
west build -b nrf52840dk/nrf52840 zephyr/samples/hello_world
west vscode -d build/nrf52840dk/nrf52840/hello_world
Note
The previous command assumes you have configured application specific build directories
with west config build.dir-fmt "build/{board}/{app}"
.
c_cpp_properties.json
Intellisense configuration for the specified application.
launch.json
Debugger configuration to launch a new instance of, or attach to a running instance of the application.