| 672 | } |
| 673 | |
| 674 | void QuickOpenPlugin::quickOpenDefinition() |
| 675 | { |
| 676 | if (jumpToSpecialObject()) { |
| 677 | return; |
| 678 | } |
| 679 | |
| 680 | KDevelop::DUChainReadLocker lock(DUChain::lock()); |
| 681 | Declaration* decl = cursorDeclaration(); |
| 682 | |
| 683 | if (!decl) { |
| 684 | qCDebug(PLUGIN_QUICKOPEN) << "Found no declaration for cursor, cannot jump"; |
| 685 | return; |
| 686 | } |
| 687 | |
| 688 | IndexedString u = decl->url(); |
| 689 | KTextEditor::Cursor c = decl->rangeInCurrentRevision().start(); |
| 690 | if (auto* def = FunctionDefinition::definition(decl)) { |
| 691 | def->activateSpecialization(); |
| 692 | u = def->url(); |
| 693 | c = def->rangeInCurrentRevision().start(); |
| 694 | } else { |
| 695 | qCDebug(PLUGIN_QUICKOPEN) << "Found no definition for declaration"; |
| 696 | decl->activateSpecialization(); |
| 697 | } |
| 698 | |
| 699 | if (u.isEmpty()) { |
| 700 | qCDebug(PLUGIN_QUICKOPEN) << "Got empty url for declaration" << decl->toString(); |
| 701 | return; |
| 702 | } |
| 703 | |
| 704 | lock.unlock(); |
| 705 | core()->documentController()->openDocument(u.toUrl(), c); |
| 706 | } |
| 707 | |
| 708 | bool QuickOpenPlugin::freeModel() |
| 709 | { |
nothing calls this directly
no test coverage detected