| 197 | } |
| 198 | |
| 199 | KDevelop::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 | |
| 215 | void BasicRefactoring::startInteractiveRename(const KDevelop::IndexedDeclaration& decl) |
| 216 | { |
nothing calls this directly
no test coverage detected