| 23 | |
| 24 | namespace { |
| 25 | Declaration *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 | |
| 37 | bool isConstructor(const Declaration *functionDecl) |
| 38 | { |
no test coverage detected