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

Method description

plugins/cmake/cmakedocumentation.cpp:63–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63KDevelop::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
93KDevelop::IDocumentation::Ptr CMakeDocumentation::documentationForDeclaration(KDevelop::Declaration* decl) const
94{

Callers

nothing calls this directly

Calls 6

typeForMethod · 0.80
findProjectForUrlMethod · 0.80
projectControllerMethod · 0.80
managerPluginMethod · 0.80
cacheValueMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected