cancel
Showing results for 
Search instead for 
Did you mean: 

clangd needs to add setting items

TanES
Associate

The code completion provided by clangd automatically introduces the header file corresponding to the function

TanES_0-1765475150851.png

TanES_1-1765475154119.png

This is a very bad thing !

A configuration item needs to be added to the setting.json to disable automatic header file insertion

TanES_2-1765476344020.png

 

 

3 REPLIES 3

Oh, yes.

I want ST32 for vscode to automatically add this configuration command when generating setting.json.
This feature of clangd is bad ! 

ankes
Associate III

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.