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

Method quickOpenDeclaration

plugins/quickopen/quickopenplugin.cpp:593–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

591}
592
593void QuickOpenPlugin::quickOpenDeclaration()
594{
595 if (jumpToSpecialObject()) {
596 return;
597 }
598
599 KDevelop::DUChainReadLocker lock(DUChain::lock());
600 Declaration* decl = cursorDeclaration();
601
602 if (!decl) {
603 qCDebug(PLUGIN_QUICKOPEN) << "Found no declaration for cursor, cannot jump";
604 return;
605 }
606 decl->activateSpecialization();
607
608 IndexedString u = decl->url();
609 KTextEditor::Cursor c = decl->rangeInCurrentRevision().start();
610
611 if (u.isEmpty()) {
612 qCDebug(PLUGIN_QUICKOPEN) << "Got empty url for declaration" << decl->toString();
613 return;
614 }
615
616 lock.unlock();
617 core()->documentController()->openDocument(u.toUrl(), c);
618}
619
620QWidget* QuickOpenPlugin::specialObjectNavigationWidget() const
621{

Callers

nothing calls this directly

Calls 11

documentControllerMethod · 0.80
cursorDeclarationFunction · 0.70
urlMethod · 0.45
startMethod · 0.45
isEmptyMethod · 0.45
toStringMethod · 0.45
unlockMethod · 0.45
openDocumentMethod · 0.45
toUrlMethod · 0.45

Tested by

no test coverage detected