| 61 | } |
| 62 | |
| 63 | KDevelop::IDocumentation::Ptr CMakeDocumentation::description(const QString& identifier, const QUrl &file) const |
| 64 | { |
| 65 | if (!file.isEmpty() && !QMimeDatabase().mimeTypeForUrl(file).inherits(QStringLiteral("text/x-cmake"))) { |
| 66 | return KDevelop::IDocumentation::Ptr(); |
| 67 | } |
| 68 | |
| 69 | |
| 70 | Type t = m_index->typeFor(identifier); |
| 71 | QString desc=descriptionForIdentifier(identifier, t); |
| 72 | |
| 73 | KDevelop::IProject* p=KDevelop::ICore::self()->projectController()->findProjectForUrl(file); |
| 74 | ICMakeManager* m=nullptr; |
| 75 | if(p) |
| 76 | m=p->managerPlugin()->extension<ICMakeManager>(); |
| 77 | if(m) |
| 78 | { |
| 79 | QPair<QString, QString> entry = m->cacheValue(p, identifier); |
| 80 | if(!entry.first.isEmpty()) |
| 81 | desc += i18n("<br /><em>Cache Value:</em> %1\n", entry.first); |
| 82 | |
| 83 | if(!entry.second.isEmpty()) |
| 84 | desc += i18n("<br /><em>Cache Documentation:</em> %1\n", entry.second); |
| 85 | } |
| 86 | |
| 87 | if(desc.isEmpty()) |
| 88 | return KDevelop::IDocumentation::Ptr(); |
| 89 | else |
| 90 | return KDevelop::IDocumentation::Ptr(new CMakeDoc(identifier, desc)); |
| 91 | } |
| 92 | |
| 93 | KDevelop::IDocumentation::Ptr CMakeDocumentation::documentationForDeclaration(KDevelop::Declaration* decl) const |
| 94 | { |
nothing calls this directly
no test coverage detected