================
@@ -152,6 +166,17 @@ 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::combineOwned(std::move(ProviderStack));
+ auto ContextProvider =
+ clang::clangd::ClangdServer::createConfiguredContextProvider(
----------------
HighCommander4 wrote:
Passing `Callbacks=nullptr` here means that diagnostics encountered while
parsing the config file will be silently dropped.
As mentioned [in the Discourse
thread](https://discourse.llvm.org/t/honor-clangd-compileflags-overrides-in-clangd-indexer/91504/3?u=highcommander4),
I think the behaviour we'd want here is to print the diagnostics to the
terminal.
There are two ways we could accomplish this:
* Give the indexer its own `ClangdServer::Callbacks` implementation and pass
that to `ClangdServer::createConfiguredcontextProvider` here
* Give the indexer its own (simpler) "create context provider from config
provider" function and use that instead of
`ClangdServer::createConfiguredContextProvider`
Not sure which one is less hassle (maybe the latter).
https://github.com/llvm/llvm-project/pull/214951
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits