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

Method declarationUnderCursor

kdevplatform/language/codegen/basicrefactoring.cpp:199–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199KDevelop::IndexedDeclaration BasicRefactoring::declarationUnderCursor(bool allowUse)
200{
201 KTextEditor::View* view = ICore::self()->documentController()->activeTextDocumentView();
202 if (!view)
203 return KDevelop::IndexedDeclaration();
204 KTextEditor::Document* doc = view->document();
205
206 DUChainReadLocker lock;
207 if (allowUse)
208 return DUChainUtils::itemUnderCursor(doc->url(), KTextEditor::Cursor(view->cursorPosition())).declaration;
209 else
210 return DUChainUtils::declarationInLine(KTextEditor::Cursor(
211 view->cursorPosition()),
212 DUChainUtils::standardContextForUrl(doc->url()));
213}
214
215void BasicRefactoring::startInteractiveRename(const KDevelop::IndexedDeclaration& decl)
216{

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected