Differential D18218 Diff 50000 kdevplatform/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp
Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp
Show First 20 Lines • Show All 413 Lines • ▼ Show 20 Line(s) | 413 | if (DUContext* argumentContext = DUChainUtils::argumentContext(d->m_declaration.data())) { | |||
---|---|---|---|---|---|
414 | decls = argumentContext->localDeclarations(topContext().data()); | 414 | decls = argumentContext->localDeclarations(topContext().data()); | ||
415 | } | 415 | } | ||
416 | foreach (const AbstractType::Ptr& argType, type->arguments()) { | 416 | foreach (const AbstractType::Ptr& argType, type->arguments()) { | ||
417 | if (!first) | 417 | if (!first) | ||
418 | modifyHtml() += QStringLiteral(", "); | 418 | modifyHtml() += QStringLiteral(", "); | ||
419 | first = false; | 419 | first = false; | ||
420 | 420 | | |||
421 | eventuallyMakeTypeLinks(argType); | 421 | eventuallyMakeTypeLinks(argType); | ||
422 | if (currentArgNum < decls.size()) { | 422 | // Must count from the back to skip possible template arguments before the function arguments. | ||
423 | int currentArgIndex = decls.size() - type->arguments().size() + currentArgNum; | ||||
424 | if (currentArgIndex >= 0 && currentArgIndex < decls.size()) { | ||||
423 | modifyHtml() += QLatin1Char(' ') + identifierHighlight( | 425 | modifyHtml() += QLatin1Char(' ') + identifierHighlight( | ||
424 | decls[currentArgNum]->identifier().toString().toHtmlEscaped(), d->m_declaration); | 426 | decls[currentArgIndex]->identifier().toString().toHtmlEscaped(), d->m_declaration); | ||
425 | } | 427 | } | ||
426 | 428 | | |||
427 | if (currentArgNum >= firstDefaultParam) { | 429 | if (currentArgNum >= firstDefaultParam) { | ||
428 | IndexedString defaultStr = function->defaultParameters()[currentArgNum - firstDefaultParam]; | 430 | IndexedString defaultStr = function->defaultParameters()[currentArgNum - firstDefaultParam]; | ||
429 | if (!defaultStr.isEmpty()) { | 431 | if (!defaultStr.isEmpty()) { | ||
430 | modifyHtml() += QLatin1String(" = ") + defaultStr.str().toHtmlEscaped(); | 432 | modifyHtml() += QLatin1String(" = ") + defaultStr.str().toHtmlEscaped(); | ||
431 | } | 433 | } | ||
432 | } | 434 | } | ||
▲ Show 20 Lines • Show All 457 Lines • Show Last 20 Lines |