Skip to main content
Visitor II
December 11, 2025
Question

clangd needs to add setting items

  • December 11, 2025
  • 2 replies
  • 90 views

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

 

 

    This topic has been closed for replies.

    2 replies

    TanESAuthor
    Visitor II
    December 11, 2025

    Oh, yes.

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

    Graduate
    December 11, 2025

    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.