https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/228683
>From 0aa73ca1dfd22e642c0baf80c49bada5fad39c52 Mon Sep 17 00:00:00 2001 From: Fil-Den <[email protected]> Date: Sat, 3 Oct 2026 11:54:39 +0300 Subject: [PATCH 1/3] [clangd-indexer] Enable config files by default --- clang-tools-extra/clangd/indexer/IndexerMain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-tools-extra/clangd/indexer/IndexerMain.cpp b/clang-tools-extra/clangd/indexer/IndexerMain.cpp index f081299552064..9dcbfe28a25cc 100644 --- a/clang-tools-extra/clangd/indexer/IndexerMain.cpp +++ b/clang-tools-extra/clangd/indexer/IndexerMain.cpp @@ -58,7 +58,7 @@ static llvm::cl::list<std::string> QueryDriverGlobs{ static llvm::cl::opt<bool> EnableConfig{ "enable-config", llvm::cl::desc(config::Provider::EnableConfigFlagDesc), - llvm::cl::init(false), + llvm::cl::init(true), }; class IndexActionFactory : public tooling::FrontendActionFactory { >From 4b81efe1a9c3cde11472ee5f7d0fc9c1e97ee58f Mon Sep 17 00:00:00 2001 From: Fil-Den <[email protected]> Date: Sat, 3 Oct 2026 12:30:16 +0300 Subject: [PATCH 2/3] fix test --- .../clangd/test/indexer-clangd-config.test | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clang-tools-extra/clangd/test/indexer-clangd-config.test b/clang-tools-extra/clangd/test/indexer-clangd-config.test index ce67f9d1eb183..f56237ae50248 100644 --- a/clang-tools-extra/clangd/test/indexer-clangd-config.test +++ b/clang-tools-extra/clangd/test/indexer-clangd-config.test @@ -9,16 +9,16 @@ # RUN: split-file %s %t.dir # RUN: echo '[{"directory":"%/t.dir/proj","command":"clang++ -c test.cpp","file":"%/t.dir/proj/test.cpp"}]' > %t.dir/compile_commands.json -# By default config is disabled, so the .clangd file's CompileFlags.Add is not +# With config explicitly disabled, the .clangd file's CompileFlags.Add is not # applied and the #error below must fire. -# RUN: env XDG_CONFIG_HOME=%t clangd-indexer %t.dir/proj/test.cpp \ -# RUN: > %t.dir/disabled.idx 2> %t.dir/disabled.log +# RUN: env XDG_CONFIG_HOME=%t clangd-indexer --enable-config=false \ +# RUN: %t.dir/proj/test.cpp > %t.dir/disabled.idx 2> %t.dir/disabled.log # RUN: FileCheck --check-prefix=DISABLED --input-file=%t.dir/disabled.log %s # DISABLED: error: "FROM_CLANGD_FILE not defined - .clangd file was not applied" -# With config enabled, the .clangd file's CompileFlags.Add should define -# FROM_CLANGD_FILE, so the #error below must not fire. -# RUN: env XDG_CONFIG_HOME=%t clangd-indexer --enable-config --executor=all-TUs \ +# By default config is enabled, so the .clangd file's CompileFlags.Add should +# define FROM_CLANGD_FILE, and the #error below must not fire. +# RUN: env XDG_CONFIG_HOME=%t clangd-indexer --executor=all-TUs \ # RUN: %t.dir/compile_commands.json > %t.dir/enabled.idx 2> %t.dir/enabled.log # RUN: FileCheck --check-prefix=ENABLED --input-file=%t.dir/enabled.log %s # ENABLED: Processing file {{.*}}test.cpp >From b99376b04e1d3dbb6a8cc39e90e33a7b2a52dcce Mon Sep 17 00:00:00 2001 From: Fil-Den <[email protected]> Date: Mon, 5 Oct 2026 22:20:28 +0300 Subject: [PATCH 3/3] Add info to release notes --- clang-tools-extra/docs/ReleaseNotes.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clang-tools-extra/docs/ReleaseNotes.md b/clang-tools-extra/docs/ReleaseNotes.md index 41aa783cabd24..be91d1c39b589 100644 --- a/clang-tools-extra/docs/ReleaseNotes.md +++ b/clang-tools-extra/docs/ReleaseNotes.md @@ -112,6 +112,10 @@ infrastructure are described first, followed by tool-specific sections. C++20 concepts. ([#206875](https://github.com/llvm/llvm-project/issues/206875)) +- `clangd-indexer` now reads clangd configuration files (`.clangd` and the + user config) by default. Pass `--enable-config=false` to restore the previous + behavior. + ### Improvements to clang-doc ### Improvements to clang-query _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
