Open mmrein opened 4 days ago
You can:
1) Configure Microsoft C/C++ extension to use Clang as described here: https://code.visualstudio.com/docs/cpp/config-clang-mac
2) Use the clang vscode extension: https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd
Then when you build your project, a compile_commands.json is generated which can be used for these extensions as described in https://docs.espressif.com/projects/vscode-esp-idf-extension/en/latest/configureproject.html#c-and-c-code-navigation-and-syntax-highlight
Is your feature request related to a problem? Please describe.
clangd extension does not recognize correct system headers
--query-driver=/home/user/.espressif/tools/xtensa-esp-elf/esp-14.2.0_20240906/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc
.clangd extension only works correctly with clangd path set to espressif one
/home/user/.espressif/tools/esp-clang/esp-18.1.2_20240912/esp-clang/bin/clangd
Describe the solution you'd like
I would prefer to use clangd for code navigation over MS C/C++ extension. Main reason being that it supports Inactive code block background highlight. AFAIK this is at this point the only IDE option for Espressif devices that supports this feature.
As new user of ESP-IDF in VSCode and clang in general, it took me far too much time to find at least those workarounds so I could work on my project in a way I was used to.
There is
c_cpp_properties.json
file for MS C/C++ extension - I would expect something simillar could be done for clangd support too?Describe alternatives you've considered