forked from qt-creator/qt-creator
Added initializers to the formal arguments.
This commit is contained in:
@@ -144,7 +144,7 @@ private:
|
||||
originalArgument->name());
|
||||
|
||||
arg->setType(q->apply(originalArgument->type()));
|
||||
arg->setInitializer(originalArgument->hasInitializer());
|
||||
arg->setInitializer(originalArgument->initializer());
|
||||
fun->arguments()->enterSymbol(arg);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "Overview.h"
|
||||
#include "TypePrettyPrinter.h"
|
||||
#include <FullySpecifiedType.h>
|
||||
#include <Literals.h>
|
||||
#include <CoreTypes.h>
|
||||
#include <Symbols.h>
|
||||
#include <Scope.h>
|
||||
@@ -334,6 +335,11 @@ void TypePrettyPrinter::visit(Function *type)
|
||||
|
||||
_text += argumentText(arg->type(), name);
|
||||
|
||||
if (const StringLiteral *initializer = arg->initializer()) {
|
||||
_text += QLatin1String(" =");
|
||||
_text += QString::fromUtf8(initializer->chars(), initializer->size());
|
||||
}
|
||||
|
||||
if (index + 1 == _overview->markedArgument())
|
||||
const_cast<Overview*>(_overview)->setMarkedArgumentEnd(_text.length());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user