Reputation: 5102
I'm using Visual Studio Code 1.93.0 in Ubuntu 24.04 with the following extensions:
and some others that should not matter for the specific question. When I open a project that uses PlatformIO IDE and C++ the IntelliSense works fine: syntax highlight, auto-completion, navigation (declarations/implementations), refactoring, etc...
Since a few days, when I open a project that uses ESP-IDF and C, it takes several minutes before all the above features are available. And every time I save a file, they stop to work for another few minutes.
I tried to:
But nothing fixed the issue.
I also noticed that every time I save a file (and until the features are available again) the process cpptools-srv
is quite active, with about 4% CPU and minimal RAM usage. Hence I don't think it's the same issue described here.
Here is my settings.json
:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${config:idf.espIdfPath}/components/**"
],
"defines": [],
"compilerPath": "${config:idf.toolsPath}/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
and my c_cpp_properties.json
:
{
"idf.adapterTargetName": "esp32s3",
"idf.flashType": "UART",
"idf.port": "/dev/ttyACM0",
"files.associations": {
"usb_serial_jtag_vfs.h": "c",
"uart_vfs.h": "c",
"common.h": "c",
"i2c_master.h": "c",
"modbus_params.h": "c",
"esp_mac.h": "c",
"freertos.h": "c",
"datetime.h": "c",
"time.h": "c",
"time_t.h": "c",
"condition_variable": "c",
"ctime": "c",
"mutex": "c",
"shared_mutex": "c",
"spi_master.h": "c",
"task_wifi.h": "c"
}
}
Following the hint of user starball I ran the extension bisect and I found out the culprit is ms-vscode.cpptools
. Of course disabling the extension is not the solution! It's odd that with other projects it works fine.
How to find out the root cause of the issue?
Upvotes: 0
Views: 53
Reputation: 1
I don't know if the problem is solved, but I'll give you the solution using my case as an example.
In my case, recent version of C/C++ Extension was the cause of the problem. There are some problems related to symbolic link of code files. In other words, the extension doesn't recognize some files in Intellisense.
I modified .json several times, updated VS Code, re-installed extensions, and so on. But nothing changed like your case.
So long introduction, and here is solution: "Downgrade your C/C++ extension to 1.19.9 version"
Then you can see that C/C++ Intellisense is working as usual.
Upvotes: 0