MCPcopy Create free account
hub / github.com/KDE/kdevelop / findParseSessionData

Method findParseSessionData

plugins/clang/duchain/duchainutils.cpp:73–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73ParseSessionData::Ptr DUChainUtils::findParseSessionData(const IndexedString &file, const IndexedString &tufile)
74{
75 DUChainReadLocker lock;
76 auto context = KDevelop::DUChainUtils::standardContextForUrl(file.toUrl());
77 if (!context || !context->ast()) {
78 // no cached data found for the current file, but maybe
79 // we are lucky and can grab it from the TU context
80 // this happens e.g. when originally a .cpp file is open and then one
81 // of its included files is opened in the editor.
82 context = KDevelop::DUChainUtils::standardContextForUrl(tufile.toUrl());
83 }
84
85 if (context) {
86 return ParseSessionData::Ptr(dynamic_cast<ParseSessionData*>(context->ast().data()));
87 }
88 return {};
89}
90
91}

Callers

nothing calls this directly

Calls 3

toUrlMethod · 0.45
astMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected