Page 1 of 1

(solved) VS Code: proper location for c_cpp_properties.json?

Posted: Fri Oct 01, 2021 4:43 pm
by mzimmers
Hi all -

I thought I had my IDE set up properly, but now I'm not so sure.

I configured it according to the instructions, and can now build and flash my app. I wanted to try an example project, so I opened that folder, and to my surprise, the system couldn't find the header files within the IDF. Doing a little more looking, I realized that my c_cpp_properties.json file is within the project directory path.

I ran the "ESP-IDF Select Where to save configuration settings," and chose "Global." I expected this to move the c_cpp_properties.json file to my home .vscode directory, but it didn't.

What is the most straightforward way to remedy this? Should I just copy (and edit) the properties file? I'd like to set this up so that every project I open at least knows where to look for the IDF.

Thanks...

Re: VS Code: proper location for c_cpp_properties.json?

Posted: Fri Oct 08, 2021 1:04 pm
by ESP_bignacio
The vscode configuration settings use a settings.json file. This can be global (User), Workspace (a .code-workspace file) or workspace folder (.vscode/settings.json) defined. This are used to configure Visual Studio Code and extension contributed settings.

The c_cpp_properties.json is a file specific to the Microsoft C/C++ extension and usually exists only in the workspace folder. This file is generated (copied from a template within the extension directory itself) by the ESP-IDF extension when you create a project with the New Project Wizard or Show Examples UI. What you defined for a specific project folder is not reflected globally.

You might need to set this file yourself depending on your project needs or just configure it to use compile_commands.json if you can build correctly.

Re: VS Code: proper location for c_cpp_properties.json?

Posted: Tue Nov 02, 2021 6:25 pm
by mzimmers
Thanks for the information, bignacio. Seems to be working correctly now.