================
@@ -152,6 +201,16 @@ int main(int argc, const char **argv) {
     return 1;
   }
 
+  clang::clangd::RealThreadsafeFS TFS;
+  std::vector<std::unique_ptr<clang::clangd::config::Provider>> ProviderStack;
+  if (clang::clangd::EnableConfig)
+    ProviderStack =
+        clang::clangd::config::Provider::createDefaultProviders(TFS);
+  auto ConfigProvider =
+      clang::clangd::config::Provider::combine(std::move(ProviderStack));
+  auto ContextProvider =
+      clang::clangd::createConfiguredContextProvider(ConfigProvider.get());
----------------
HighCommander4 wrote:

Looking at this again, I realized that printing the config diagnostics to the 
command line is exactly the behaviour that 
`ClangdServer::createConfiguredContextProvider` degrades to if passed a null 
`Callbacks` (since it prints them 
[here](https://searchfox.org/llvm/rev/c4048fb6de5097256045212f9f80c5f0ab41deed/clang-tools-extra/clangd/ClangdServer.cpp#399-400),
 and that code is reached even if `Callbacks` is null; only [this 
part](https://searchfox.org/llvm/rev/c4048fb6de5097256045212f9f80c5f0ab41deed/clang-tools-extra/clangd/ClangdServer.cpp#413-414)
 is skipped).

So in fact we can just use `ClangdServer::createConfiguredContextProvider` with 
a null callback and it will be equivalent.

Sorry for overlooking this before and asking you to change this, my bad :/

https://github.com/llvm/llvm-project/pull/214951
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to