forked from qt-creator/qt-creator
CppEditor: Add template enclosing scope on "Insert Declaration"
Change-Id: Iff4893193b56c2ed86b4b9515a1a1df847528369 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
2890966ec3
commit
5a40bddf08
@@ -2508,9 +2508,15 @@ QString InsertDeclOperation::generateDeclaration(const Function *function)
|
||||
oo.showFunctionSignatures = true;
|
||||
oo.showReturnTypes = true;
|
||||
oo.showArgumentNames = true;
|
||||
oo.showEnclosingTemplate = true;
|
||||
|
||||
const Symbol *symbol = function;
|
||||
if (const Scope *enclosingScope = function->enclosingScope()) {
|
||||
if (const Template *templ = enclosingScope->asTemplate())
|
||||
symbol = templ;
|
||||
}
|
||||
QString decl;
|
||||
decl += oo.prettyType(function->type(), function->unqualifiedName());
|
||||
decl += oo.prettyType(symbol->type(), function->unqualifiedName());
|
||||
decl += QLatin1String(";\n");
|
||||
|
||||
return decl;
|
||||
|
||||
Reference in New Issue
Block a user