New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should cbuild setup
also create .clangd
for setting up Intellisense?
#1400
Comments
The Clangd config files are documented here: https://clangd.llvm.org/config. They are read by the clangd language server to configure intellisense in the containing folder and its children. They are not considered by other intellisense engines, such as the Microsoft C/C++ extension. The Csolution extension also integrates to C/C++ via a VS Code extension API. The extension creates one
Thoughts:
|
I should probably note that a lot of the flags you'll see in the .clangd are superfluous. clangd should already be aware of most of them, like the architectural ones (MS C/C++ too has its own method of querying a toolchain for such). The important defines are the armclang specific ones (e.g. ARMCOMPILER_LIBCXX, ARMCOMPILER_VERSION etc.). But seeing as we don't have an exact/complete list of those, we currently play it safe and add everything armclang gives us back. It's not perfect, but as Matt notes, this is in theory just a short term workaround. |
Do we need to generate .clangd file with tool-box for compiler version dependency? |
Is this a priority for 2.4.0? |
Can we directly get that |
@Eplankton, I am currently not aware of any way that would generate the
Note: you need to use your default command line options to match your circumstances. |
The Problem To Be Discussed
Currently
cbuild setup
generatescompile_commands.json
for Intellisense in thetmp
directory for the related context.In VS Code using the CLang intellisense engine, there is also a file in the project root named
.clangd
. In some cases this file seems to contain define settings that communicate architecture specific defines. Such defines are used in CMSIS header files, so it is likely that intellisense fails without it.For example a project targeting a Cortex-M85 contains in
clangd
this:My questions are therefore:
.clangd
generated by thecbuild setup
?.clangd
working across the different intellisense engines?.clangd
compiler specific?The text was updated successfully, but these errors were encountered: