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

Method findDeclaration

plugins/contextbrowser/contextbrowser.cpp:768–788  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766}
767
768Declaration* ContextBrowserPlugin::findDeclaration(View* view, const KTextEditor::Cursor& position, bool mouseHighlight)
769{
770 Q_UNUSED(mouseHighlight);
771 ENSURE_CHAIN_READ_LOCKED
772
773 Declaration* foundDeclaration = nullptr;
774 if (m_useDeclaration.data()) {
775 foundDeclaration = m_useDeclaration.data();
776 } else {
777 //If we haven't found a special language object, search for a use/declaration and eventually highlight it
778 foundDeclaration =
779 DUChainUtils::declarationForDefinition(DUChainUtils::itemUnderCursor(
780 view->document()->url(), position).declaration);
781 if (foundDeclaration && foundDeclaration->kind() == Declaration::Alias) {
782 auto* alias = dynamic_cast<AliasDeclaration*>(foundDeclaration);
783 Q_ASSERT(alias);
784 foundDeclaration = alias->aliasedDeclaration().declaration();
785 }
786 }
787 return foundDeclaration;
788}
789
790ContextBrowserView* ContextBrowserPlugin::browserViewForWidget(QWidget* widget) const
791{

Callers

nothing calls this directly

Calls 6

aliasedDeclarationMethod · 0.80
dataMethod · 0.45
urlMethod · 0.45
documentMethod · 0.45
kindMethod · 0.45
declarationMethod · 0.45

Tested by

no test coverage detected