| 315 | } |
| 316 | |
| 317 | DUChainUtils::ItemUnderCursor DUChainUtils::itemUnderCursor(const QUrl& url, const KTextEditor::Cursor& cursor) |
| 318 | { |
| 319 | KDevelop::TopDUContext* top = standardContextForUrl(url.adjusted(QUrl::NormalizePathSegments)); |
| 320 | |
| 321 | if(!top) { |
| 322 | return {nullptr, nullptr, KTextEditor::Range()}; |
| 323 | } |
| 324 | |
| 325 | ItemUnderCursorInternal decl = itemUnderCursorInternal(top->transformToLocalRevision(cursor), top, RangeInRevision::Default); |
| 326 | if (decl.declaration == nullptr) |
| 327 | { |
| 328 | decl = itemUnderCursorInternal(top->transformToLocalRevision(cursor), top, RangeInRevision::IncludeBackEdge); |
| 329 | } |
| 330 | return {decl.declaration, decl.context, top->transformFromLocalRevision(decl.range)}; |
| 331 | } |
| 332 | |
| 333 | Declaration* DUChainUtils::declarationForDefinition(Declaration* definition, TopDUContext* topContext) |
| 334 | { |
nothing calls this directly
no test coverage detected