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

Method declarationForDefinition

kdevplatform/language/duchain/duchainutils.cpp:333–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333Declaration* DUChainUtils::declarationForDefinition(Declaration* definition, TopDUContext* topContext)
334{
335 if(!definition)
336 return nullptr;
337
338 if(!topContext)
339 topContext = definition->topContext();
340
341 if(dynamic_cast<FunctionDefinition*>(definition)) {
342 Declaration* ret = static_cast<FunctionDefinition*>(definition)->declaration();
343 if(ret)
344 return ret;
345 }
346
347 return definition;
348}
349
350Declaration* DUChainUtils::declarationInLine(const KTextEditor::Cursor& _cursor, DUContext* ctx) {
351 if(!ctx)

Callers

nothing calls this directly

Calls 2

topContextMethod · 0.45
declarationMethod · 0.45

Tested by

no test coverage detected