| 31 | } |
| 32 | |
| 33 | QString DUChainItemData::text() const |
| 34 | { |
| 35 | DUChainReadLocker lock; |
| 36 | Declaration* decl = m_item.m_item.data(); |
| 37 | if (!decl) { |
| 38 | return i18n("Not available any more: %1", m_item.m_text); |
| 39 | } |
| 40 | |
| 41 | if (auto* def = dynamic_cast<FunctionDefinition*>(decl)) { |
| 42 | if (def->declaration()) { |
| 43 | decl = def->declaration(); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | QString text = decl->qualifiedIdentifier().toString(); |
| 48 | |
| 49 | if (!decl->abstractType()) { |
| 50 | //With simplified representation, still mark functions as such by adding parens |
| 51 | if (dynamic_cast<AbstractFunctionDeclaration*>(decl)) { |
| 52 | text += QLatin1String("(...)"); |
| 53 | } |
| 54 | } else if (TypePtr<FunctionType> function = decl->type<FunctionType>()) { |
| 55 | text += function->partToString(FunctionType::SignatureArguments); |
| 56 | } |
| 57 | |
| 58 | return text; |
| 59 | } |
| 60 | |
| 61 | QList<QVariant> DUChainItemData::highlighting() const |
| 62 | { |
nothing calls this directly
no test coverage detected