[PATCH] D90775: [clangd] ExternalIndex turns off BackgroundIndex only if it isn't set

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 9 13:45:17 PST 2020


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:308
+          if (C.Index.Background == Config::BackgroundPolicy::Auto)
+            C.Index.Background = Config::BackgroundPolicy::Skip;
         });
----------------
sammccall wrote:
> doesn't this mean that if a user has explicit `Background: Build` at a higher scope, then a more narrowly scoped external index won't disable it?
> 
> This seems at least as confusing as the problems this is trying to solve.
> doesn't this mean that if a user has explicit Background: Build at a higher scope, then a more narrowly scoped external index won't disable it?

Yes. The motivating case I had was something like this:
- Let's say user turns background-index on inside `llvm-project/clang-tools-extra/clangd/.clangd`.
- Defines an external index via user-config for `llvm-project`.

Since user-config is the inner-most provider, it will turn off the backgrond-indexing implicitly for the whole project, and user won't be able to turn it on for a subdirectory without specifying that in user-config directory too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90775/new/

https://reviews.llvm.org/D90775



More information about the cfe-commits mailing list