================
@@ -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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to