Select an Espressif target (esp32, esp32s2, etc.) by going to View > CommandPalette and entering ESP-IDF:SetEspressifDeviceTarget command.
Go to View > CommandPalette and enter ESP-IDF:SelectOpenOCDBoardConfiguration to choose the openOCD configuration files for the extension openOCD server.
C and C++ Code Navigation and Syntax Highlighting
Note
C and C++ code navigation is automatically configured if you create the project as described in Configure Your Project. Those commands generate the {PROJECT_DIRECTORY_PATH}/.vscode/c_cpp_properties.json file.
Usually C/C++ language extensions rely on a file called compile_commands.json, which is located in your project build directory. You can generate this file using the ESP-IDF:Runidf.pyreconfiguretask.
For LLVM clangd extension, only compile_commands.json is needed. For Microsoft C/C++ extension, a configuration file is located at {PROJECT_DIRECTORY_PATH}/.vscode/c_cpp_properties.json. This file can be generated by creating a project using ESP-IDF:NewProject, ESP-IDF:ShowExampleProjects command, or by using the ESP-IDF:Add.vscodeConfigurationFolder command on an existing ESP-IDF projects.