VS Code help

User avatar
klaatu2
Posts: 36
Joined: Wed Feb 08, 2023 11:32 pm
Location: TEXAS

VS Code help

Postby klaatu2 » Wed Feb 05, 2025 4:45 am

I'm messing with an ESP32 example
It compiles, flashes and runs fine
But in main.c, VS code underlines in RED all the include files and when hovered over: "Can't open source file"

While ESP-IDF compiles and apparently knows the path, VS code does not.
How do you fix this, so that I can hyperlink to these files from within main.c :?:

MicroController
Posts: 2045
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: VS Code help

Postby MicroController » Wed Feb 05, 2025 8:23 pm

Sometimes, CTRL+left-click on the include name does make VSCode search for and find the right file.
Another thing to try: F1, "> C/C++: Change Configuration Provider..." -> CMake Tools

User avatar
klaatu2
Posts: 36
Joined: Wed Feb 08, 2023 11:32 pm
Location: TEXAS

Re: VS Code help

Postby klaatu2 » Wed Feb 05, 2025 11:01 pm

Under "Change Configuration Provider", there is only one item listed: (None)

MicroController
Posts: 2045
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: VS Code help

Postby MicroController » Thu Feb 06, 2025 12:35 am

Then you may want to install the cmake extension and check again.

User avatar
klaatu2
Posts: 36
Joined: Wed Feb 08, 2023 11:32 pm
Location: TEXAS

Re: VS Code help

Postby klaatu2 » Thu Feb 06, 2025 2:32 am

" install the cmake extension" ?

Do you mean the "Microsoft C/C++ Extension Pack"?

I already have the "Microsoft C/C++ Visual Studio Code", installed

I also see the "CMake Extension Pack" by mischelebuha, and "CMake Tools" by Microsoft.

Not clear which you mean

username
Posts: 563
Joined: Thu May 03, 2018 1:18 pm

Re: VS Code help

Postby username » Thu Feb 06, 2025 2:45 am

Did you try creating a new project and see if everything works ok first ?

User avatar
klaatu2
Posts: 36
Joined: Wed Feb 08, 2023 11:32 pm
Location: TEXAS

Re: VS Code help

Postby klaatu2 » Wed Feb 12, 2025 5:46 pm

The issue is directly related to the Microsoft C/C++ Intellisense extension.
There needs to be a c_cpp_properties.json file in the vscode folder.
Details here:
https://docs.espressif.com/projects/vsc ... oject.html

I manually created the file and inserted the file structure detailed at the link above, and hyperlinking to include files all work now.

Who is online

Users browsing this forum: plater and 89 guests