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

Function cursorDeclaration

plugins/quickopen/quickopenplugin.cpp:167–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165K_PLUGIN_FACTORY_WITH_JSON(KDevQuickOpenFactory, "kdevquickopen.json", registerPlugin<QuickOpenPlugin>(); )
166
167Declaration * cursorDeclaration() {
168 KTextEditor::View* view = ICore::self()->documentController()->activeTextDocumentView();
169 if (!view) {
170 return nullptr;
171 }
172
173 KDevelop::DUChainReadLocker lock(DUChain::lock());
174
175 return DUChainUtils::declarationForDefinition(DUChainUtils::itemUnderCursor(view->document()->url(), KTextEditor::Cursor(view->cursorPosition())).declaration);
176}
177
178///The first definition that belongs to a context that surrounds the current cursor
179Declaration* cursorContextDeclaration()

Callers 3

cursorItemTextFunction · 0.70
quickOpenDeclarationMethod · 0.70
quickOpenDefinitionMethod · 0.70

Calls 6

documentControllerMethod · 0.80
CursorClass · 0.70
urlMethod · 0.45
documentMethod · 0.45
cursorPositionMethod · 0.45

Tested by

no test coverage detected