2025-12-11 10:09 AM
The code completion provided by clangd automatically introduces the header file corresponding to the function
This is a very bad thing !
A configuration item needs to be added to the setting.json to disable automatic header file insertion
2025-12-11 10:56 AM
2025-12-11 11:07 AM - edited 2025-12-11 11:09 AM
Oh, yes.
I want ST32 for vscode to automatically add this configuration command when generating setting.json.
This feature of clangd is bad !
2025-12-11 1:39 PM
That's a bit of tic-tac-toe, I'd say.
Some developers like clangd's feature while others do not. For one reason or another clangd's developers have chosen the default setting for this feature, and you might find it quite a steep hill to convince ST's engineers to deviate from the default, as the extension is intended to act as a "drop-in replacement" for the official clangd one from LLVM.
You can always switch it off in the way you already showed, or you can add a ".clangd" file to the repository and put "HeaderInsertion: never" in there. It accomplishes the same thing.