const CanonicalIncludes &CanonIncludes) override {
if (FIndex)
FIndex->updatePreamble(Path, Version, Ctx, std::move(PP), CanonIncludes);
- if (ServerCallbacks)
- ServerCallbacks->onSemanticsMaybeChanged(Path);
}
void onMainAST(PathRef Path, ParsedAST &AST, PublishFn Publish) override {
ServerCallbacks->onFileUpdated(File, Status);
}
+ void onPreamblePublished(PathRef File) override {
+ if (ServerCallbacks)
+ ServerCallbacks->onSemanticsMaybeChanged(File);
+ }
+
private:
FileIndex *FIndex;
ClangdServer::Callbacks *ServerCallbacks;
ASTPeer.updatePreamble(std::move(Req.CI), std::move(Req.Inputs),
LatestBuild, std::move(Req.CIDiags),
std::move(Req.WantDiags));
+ Callbacks.onPreamblePublished(FileName);
});
if (!LatestBuild || Inputs.ForceRebuild) {
/// Called whenever the TU status is updated.
virtual void onFileUpdated(PathRef File, const TUStatus &Status) {}
+
+ /// Preamble for the TU have changed. This might imply new semantics (e.g.
+ /// different highlightings). Any actions on the file are guranteed to see new
+ /// preamble after the callback.
+ virtual void onPreamblePublished(PathRef File) {}
};
/// Handles running tasks for ClangdServer and managing the resources (e.g.,