Commit 3f99e3de authored by Shashwat Dixit's avatar Shashwat Dixit Committed by Kevin Funk
Browse files

Do not add return type to constructors declaration when editing definition in signature assistant.

BUG: 365420

Reviewers: kfunk, mwolff, #kdevelop, brauch

Reviewed By: mwolff, #kdevelop, brauch

Subscribers: brauch, apol, #kdevelop, kdevelop-devel

Tags: #kdevelop

Differential Revision:

(cherry picked from commit e334d754)
parent dd038eb1
......@@ -48,7 +48,7 @@ Declaration *getDeclarationAtCursor(const KTextEditor::Cursor &cursor, const QUr
bool isConstructor(const Declaration *functionDecl)
auto classFun = dynamic_cast<const ClassFunctionDeclaration*>(functionDecl);
auto classFun = dynamic_cast<const ClassFunctionDeclaration*>(DUChainUtils::declarationForDefinition(const_cast<Declaration*>(functionDecl)));
return classFun && classFun->isConstructor();
......@@ -484,6 +484,14 @@ void TestAssistants::testSignatureAssistant_data()
<< "class Foo { Foo(char c); };"
<< "Foo::Foo(char c)\n{}";
// see
<< "class Foo {\nFoo(int a); \n};"
<< "Foo::Foo(int a)\n{}"
<< (QList<StateChange>() << StateChange(Testbed::CppDoc, Range(0,13,0,14), QStringLiteral("b"), SHOULD_ASSIST))
<< "class Foo {\nFoo(int b); \n};"
<< "Foo::Foo(int b)\n{}";
// see
<< "struct Foo { int bar(); };"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment