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

Method functionSignatureRange

plugins/clang/duchain/duchainutils.cpp:26–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace ClangIntegration {
25
26KTextEditor::Range DUChainUtils::functionSignatureRange(const Declaration* decl)
27{
28 if (!decl->isFunctionDeclaration()) {
29 qCWarning(KDEV_CLANG) << "Invalid declaration:" << decl;
30 return {};
31 }
32
33 auto functionContext = decl->internalContext();
34 Q_ASSERT(functionContext);
35 auto childContexts = functionContext->childContexts();
36 if (childContexts.isEmpty()) {
37 return functionContext->rangeInCurrentRevision();
38 }
39
40 const auto start = functionContext->rangeInCurrentRevision().start();
41 const auto end = childContexts[0]->rangeInCurrentRevision().start();
42 return {start, end};
43}
44
45void DUChainUtils::registerDUChainItems()
46{

Callers

nothing calls this directly

Calls 6

childContextsMethod · 0.80
isFunctionDeclarationMethod · 0.45
internalContextMethod · 0.45
isEmptyMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected