| 693 | } |
| 694 | |
| 695 | QPair<QWidget*, KTextEditor::Range> CMakeManager::specialLanguageObjectNavigationWidget(const QUrl& url, const KTextEditor::Cursor& position) |
| 696 | { |
| 697 | KTextEditor::Range itemRange; |
| 698 | CMakeNavigationWidget* doc = nullptr; |
| 699 | |
| 700 | KDevelop::TopDUContextPointer top= TopDUContextPointer(KDevelop::DUChain::self()->chainForDocument(url)); |
| 701 | if(top) |
| 702 | { |
| 703 | int useAt=top->findUseAt(top->transformToLocalRevision(position)); |
| 704 | if(useAt>=0) |
| 705 | { |
| 706 | Use u=top->uses()[useAt]; |
| 707 | doc = new CMakeNavigationWidget(top, u.usedDeclaration(top->topContext())); |
| 708 | itemRange = u.m_range.castToSimpleRange(); |
| 709 | } |
| 710 | } |
| 711 | |
| 712 | if (!doc) { |
| 713 | ICMakeDocumentation* docu=CMake::cmakeDocumentation(); |
| 714 | if( docu ) |
| 715 | { |
| 716 | const auto* document = ICore::self()->documentController()->documentForUrl(url); |
| 717 | const auto* textDocument = document->textDocument(); |
| 718 | itemRange = termRangeAtPosition(textDocument, position); |
| 719 | if (itemRange.isValid()) { |
| 720 | const auto id = textDocument->text(itemRange); |
| 721 | |
| 722 | if (!id.isEmpty()) { |
| 723 | IDocumentation::Ptr desc=docu->description(id, url); |
| 724 | if (desc) { |
| 725 | doc=new CMakeNavigationWidget(top, desc); |
| 726 | } |
| 727 | } |
| 728 | } |
| 729 | } |
| 730 | } |
| 731 | |
| 732 | return {doc, itemRange}; |
| 733 | } |
| 734 | |
| 735 | QPair<QString, QString> CMakeManager::cacheValue(KDevelop::IProject* /*project*/, const QString& /*id*/) const |
| 736 | { return QPair<QString, QString>(); } |
nothing calls this directly
no test coverage detected