[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 21 20:36:10 PDT 2024


HighCommander4 wrote:

> `FlagConfigProvider` is pushed in the vector after `.clangd` config in [CLangdMain.cpp](https://github.com/llvm/llvm-project/blob/a4586bd2d4fa7d6c0100893496a9383fd581e2e9/clang-tools-extra/clangd/tool/ClangdMain.cpp#L926) Then [ConfigProvider.cpp](https://github.com/llvm/llvm-project/blob/5ac97d397c2088c3ac0a113506e57ab9b1e69ac8/clang-tools-extra/clangd/ConfigProvider.cpp#L154) just iterates over it, which means that `FlagConfigProvider` is evaluated **after** `.clangd` and will override it!

Thanks for catching that; I was under the mistaken impression that it was the other way around!

I think it would be a nicer user experience if the config file took precedence over compile flags... but since that's not the case today for existing flags (like `--background-index`), I think it's appropriate for this patch to remain consistent with the existing behaviour.

In other words, I think what the current version of the patch is doing is fine.

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


More information about the cfe-commits mailing list