Visual Studio Code c_cpp_properties content to satisfy IntelliSense and to stop annoy people

anthropophagus
Posts: 3
Joined: Fri Apr 02, 2021 6:35 pm

Visual Studio Code c_cpp_properties content to satisfy IntelliSense and to stop annoy people

Postby anthropophagus » Wed Apr 07, 2021 8:15 am

Hello,

After hours of googling and testing various c_cpp_properties settings, my current version looks like this:

Code: Select all

{
    "configurations": [
        {
            "name": "Linux",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "includePath": [
                "${config:idf.espIdfPath}/components/**",
                "${workspaceFolder}/**"
            ],
            "browse": {
                "path": [
                    "${config:idf.espIdfPath}/components",
                    "${workspaceFolder}"
                ],
                "limitSymbolsToIncludedHeaders": false
            },
            "compilerPath": "/home/myname/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc"
        }
    ],
    "version": 4
}
IntelliSense no more screams at me about any of libraries but it does not like some of the sdkconfig defined constants. For example, if I put this in c_cpp_properties.json in the blink example project, IntelliSense says that CONFIG_BLINK_PERIOD is undefined and portTICK_PERIOD_MS definition includes CONFIG_FREERTOS_HZ which is also undefined. In case of wifi station example, IntelliSense warns me about EXAMPLE_ESP_MAXIMUM_RETRY as it thinks that CONFIG_ESP_MAXIMUM_RETRY is undefined etc. This is really annoying so I would be really happy if any of you could tell me what else should I add to my c_cpp_properties.json so that I could happily use the ESP-IDF on Visual Studio Code.
I am using ESP-IDF 4.2, if that helps.

boarchuz
Posts: 606
Joined: Tue Aug 21, 2018 5:28 am

Re: Visual Studio Code c_cpp_properties content to satisfy IntelliSense and to stop annoy people

Postby boarchuz » Wed Apr 07, 2021 10:13 am

See https://github.com/espressif/vscode-esp ... URATION.md (especially the bottom config which includes the compileCommands field)

This file is generated upon build so expect squiggles until the first time doing so.

You can add this to your includePath if you want Intellisense to find your config before the above is available:
"${workspaceFolder}/build/config"

Who is online

Users browsing this forum: No registered users and 24 guests