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

Function typeForShortenedString

plugins/clang/codegen/codegenhelper.cpp:308–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306
307namespace CodegenHelper {
308AbstractType::Ptr typeForShortenedString(Declaration* decl)
309{
310 AbstractType::Ptr type = decl->abstractType();
311 if (decl->isTypeAlias()) {
312 if (auto alias = type.dynamicCast<TypeAliasType>()) {
313 type = alias->type();
314 }
315 }
316
317 if (decl->isFunctionDeclaration()) {
318 FunctionType::Ptr funType = decl->type<FunctionType>();
319 if (!funType) {
320 return AbstractType::Ptr();
321 }
322 type = funType->returnType();
323 }
324 return type;
325}
326
327QString shortenedTypeString(Declaration* decl, DUContext* ctx, int desiredLength, const QualifiedIdentifier& stripPrefix)
328{

Callers 1

shortenedTypeStringFunction · 0.85

Calls 5

isTypeAliasMethod · 0.80
abstractTypeMethod · 0.45
typeMethod · 0.45
isFunctionDeclarationMethod · 0.45
returnTypeMethod · 0.45

Tested by

no test coverage detected