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

Function getDeclarationAtCursor

plugins/clang/codegen/adaptsignatureassistant.cpp:25–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24namespace {
25Declaration *getDeclarationAtCursor(const KTextEditor::Cursor &cursor, const QUrl &documentUrl)
26{
27 ENSURE_CHAIN_READ_LOCKED
28 ReferencedTopDUContext top(DUChainUtils::standardContextForUrl(documentUrl));
29 if (!top) {
30 clangDebug() << "no context found for document" << documentUrl;
31 return nullptr;
32 }
33 const auto *context = top->findContextAt(top->transformToLocalRevision(cursor), true);
34 return context->type() == DUContext::Function ? context->owner() : nullptr;
35}
36
37bool isConstructor(const Declaration *functionDecl)
38{

Callers 2

textChangedMethod · 0.85
updateReadyMethod · 0.85

Calls 4

findContextAtMethod · 0.80
typeMethod · 0.45
ownerMethod · 0.45

Tested by

no test coverage detected