[clang-tools-extra] [clangd] Add `HeaderInsertion` yaml config option (PR #128503)

kadir çetinkaya via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 15 23:24:35 PDT 2025


================
@@ -341,6 +341,14 @@ struct Fragment {
     ///   Delimiters: empty pair of delimiters "()" or "<>"
     ///   FullPlaceholders: full name of both type and parameter
     std::optional<Located<std::string>> ArgumentLists;
+    /// Add #include directives when accepting code completions. Config
+    /// equivalent of the CLI option '--header-insertion'
+    /// Valid values are enum Config::HeaderInsertionPolicy values:
+    ///   "IWYU": Include what you use. Insert the owning header for top-level
+    ///     symbols, unless the header is already directly included or the
+    ///     symbol is forward-declared
+    ///   "NeverInsert": Never insert headers
----------------
kadircet wrote:

looks like there's a slight discrepancy here; value is documented as `NeverInsert` here, but config-compiler expects `Never`. Can you amend one of those?

https://github.com/llvm/llvm-project/pull/128503


More information about the cfe-commits mailing list