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

Method itemUnderCursor

kdevplatform/language/duchain/duchainutils.cpp:317–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317DUChainUtils::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
333Declaration* DUChainUtils::declarationForDefinition(Declaration* definition, TopDUContext* topContext)
334{

Callers

nothing calls this directly

Calls 4

itemUnderCursorInternalFunction · 0.85
RangeClass · 0.70

Tested by

no test coverage detected