[clang-tools-extra] [clangd] Re-land "support outgoing calls in call hierarchy" (PR #117673)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 28 00:03:46 PST 2024


================
@@ -88,9 +90,12 @@ struct UpdateIndexCallbacks : public ParsingCallbacks {
       indexStdlib(CI, std::move(*Loc));
 
     // FIndex outlives the UpdateIndexCallbacks.
-    auto Task = [FIndex(FIndex), Path(Path.str()), Version(Version.str()),
+    auto Task = [this, FIndex(FIndex), Path(Path.str()), Version(Version.str()),
                  ASTCtx(std::move(ASTCtx)), PI(std::move(PI))]() mutable {
       trace::Span Tracer("PreambleIndexing");
+      std::optional<WithContext> WithProvidedContext;
+      if (ContextProvider)
+        WithProvidedContext.emplace(ContextProvider(""));
----------------
HighCommander4 wrote:

@kadircet Not sure if this is important: it disables the building of the `RevRefs` data structure for the dynamic index.

While we do have a `Path` available to pass to the context provider here, I'm not passing it to remain consistent with the background index codepath, which only looks at the user config as explained in my previous comment.

(Also, is it fine to capture `this` in this lambda, lifetime-wise?)

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


More information about the cfe-commits mailing list