[clang-tools-extra] [clangd] Enable config files by default in clangd-indexer (PR #228683)
https://github.com/HighCommander4 auto_merge_enabled https://github.com/llvm/llvm-project/pull/228683 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clangd] Enable config files by default in clangd-indexer (PR #228683)
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
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 QueryDriverGlobs{
static llvm::cl::opt 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
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
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
[clang-tools-extra] [clangd] Enable config files by default in clangd-indexer (PR #228683)
https://github.com/HighCommander4 approved this pull request. https://github.com/llvm/llvm-project/pull/228683 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clangd] Enable config files by default in clangd-indexer (PR #228683)
https://github.com/HighCommander4 requested changes to this pull request. The code changes look good, but let's mention this in the [release notes](https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/docs/ReleaseNotes.md#improvements-to-clangd) as well. https://github.com/llvm/llvm-project/pull/228683 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clangd] Enable config files by default in clangd-indexer (PR #228683)
llvmorg-github-actions[bot] wrote:
@llvm/pr-subscribers-clangd
Author: Denis (Fil-Den)
Changes
This is a continuation of #214951. It enables config file support by
default. The change is small, so it can be easily reverted if needed.
---
Full diff: https://github.com/llvm/llvm-project/pull/228683.diff
2 Files Affected:
- (modified) clang-tools-extra/clangd/indexer/IndexerMain.cpp (+1-1)
- (modified) clang-tools-extra/clangd/test/indexer-clangd-config.test (+6-6)
``diff
diff --git a/clang-tools-extra/clangd/indexer/IndexerMain.cpp
b/clang-tools-extra/clangd/indexer/IndexerMain.cpp
index f0812995520648..9dcbfe28a25cc0 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 QueryDriverGlobs{
static llvm::cl::opt EnableConfig{
"enable-config",
llvm::cl::desc(config::Provider::EnableConfigFlagDesc),
-llvm::cl::init(false),
+llvm::cl::init(true),
};
class IndexActionFactory : public tooling::FrontendActionFactory {
diff --git a/clang-tools-extra/clangd/test/indexer-clangd-config.test
b/clang-tools-extra/clangd/test/indexer-clangd-config.test
index ce67f9d1eb183a..f56237ae502485 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
``
https://github.com/llvm/llvm-project/pull/228683
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clangd] Enable config files by default in clangd-indexer (PR #228683)
https://github.com/Fil-Den ready_for_review https://github.com/llvm/llvm-project/pull/228683 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clangd] Enable config files by default in clangd-indexer (PR #228683)
https://github.com/Fil-Den created
https://github.com/llvm/llvm-project/pull/228683
This is a continuation of #214951. It enables config file support by default.
The change is small, so it can be easily reverted if needed.
>From 0aa73ca1dfd22e642c0baf80c49bada5fad39c52 Mon Sep 17 00:00:00 2001
From: Fil-Den
Date: Sat, 3 Oct 2026 11:54:39 +0300
Subject: [PATCH] [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 f0812995520648..9dcbfe28a25cc0 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 QueryDriverGlobs{
static llvm::cl::opt EnableConfig{
"enable-config",
llvm::cl::desc(config::Provider::EnableConfigFlagDesc),
-llvm::cl::init(false),
+llvm::cl::init(true),
};
class IndexActionFactory : public tooling::FrontendActionFactory {
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clangd] Enable config files by default in clangd-indexer (PR #228683)
https://github.com/Fil-Den updated
https://github.com/llvm/llvm-project/pull/228683
>From 0aa73ca1dfd22e642c0baf80c49bada5fad39c52 Mon Sep 17 00:00:00 2001
From: Fil-Den
Date: Sat, 3 Oct 2026 11:54:39 +0300
Subject: [PATCH 1/2] [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 f0812995520648..9dcbfe28a25cc0 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 QueryDriverGlobs{
static llvm::cl::opt 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
Date: Sat, 3 Oct 2026 12:30:16 +0300
Subject: [PATCH 2/2] 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 ce67f9d1eb183a..f56237ae502485 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
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
