VS Code "go to definition" includes IDF

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

VS Code "go to definition" includes IDF

Postby mzimmers » Tue Jul 12, 2022 5:39 pm

Hi all -

Is there a way to get the "go to definition" command to exclude the IDF components? On my system, if my application uses a symbol name that is also found in the IDF, it finds those instead of the one in my own code.

Thanks...

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: VS Code "go to definition" includes IDF

Postby ESP_bignacio » Mon Jul 25, 2022 9:54 am

You should update the <project-directory/.vscode/c_cpp_properties.json file as shown in c_cpp_configuration documentation. The best configuration is usually the one using the compile_commands.json but you could remove/update those browse paths in ESP-IDF components.

EDIT: Apologies, wrong url formatting.

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: VS Code "go to definition" includes IDF

Postby mzimmers » Fri Jul 29, 2022 6:21 pm

Thanks, bignacio. Does the file compile_commands.json have to reside in the build directory? I'd like it to be a bit more permanent.

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: VS Code "go to definition" includes IDF

Postby mzimmers » Mon Aug 01, 2022 3:45 pm

There's something about the build process I still don't understand. If I do a clean, I get build errors when I try to build from within the IDE. Running idf.py build fixes that, but it also wipes out my compile_commands.json file, and replaces it with about 4800 lines including a ton of files from the IDE. Do you have any idea why this is happening?

Thanks...

Who is online

Users browsing this forum: No registered users and 26 guests