I attached exampled simple project. When I rename first parameter in constructor I get broken its definition. Looking like this: void MyClass::MyClass(int* nPointer, const QString& string) Please take a look on the class declaration (located in header file): #include <QString> class MyClass { public: /** This function something do. * @param pointer some pointer * @param string some string */ MyClass( int *pointer, const QString &string ); // void foo(); }; #endif // MYCLASS_H and class declaration (located in cpp file): #include "myclass.h" MyClass::MyClass( int *pointer, const QString &string ) { int *localPointer = pointer; QString localString = string; } /* void MyClass::foo() { } */ Reproducible: Always Steps to Reproduce: 1. Run KDevelop and open attached project (or create your own and put there mentioned above code) 2. In declaration of constructor please rename its first argument: "pointer" to "nPointer" 3. When helper "Adapt Signature" pop out then please choose option "1" (Update definition of signature) 4. Please switch editor to cpp file Actual Results: void MyClass::MyClass(int* nPointer, const QString& string) Additionally as you can see the format of arguments (spaces and * and & location) is lost and I have to restore all to the original. This is really annoying :/. I can report separate bug report for this if this is necessary. This also happened in KDevelop 4. Expected Results: MyClass::MyClass( int *nPointer, const QString &string ) KTextEditor, Kate, KDevelop, KDevplatform cloned at 14.11.2015, where KDevelop, KDevplatform come from 5.0 branch Would be nice if after this operation also argument in doxygen documentation would be updated. Now is only highlighted by Problem reporter.
Created attachment 95504 [details] Simple C++ project containing only one class with one constructor
Haven't tried this explicit example, but I've seen odd behavior of the signature assistant myself. Regarding the syntax formatting: Have you configured that properly? KDevelop settings -> Source Formatter. There, use e.g. astyle and configure it to your likings. It should then be used by the assistants. If not, open a new bug report for that please.
Git commit 95e7dd4e07adcd3cd29a2d998fb4076b80746c11 by Milian Wolff. Committed on 30/01/2016 at 15:51. Pushed by mwolff into branch '5.0'. Do not add return type to constructors in signature assistant. M +6 -4 languages/clang/codegen/adaptsignatureaction.cpp M +11 -3 languages/clang/codegen/adaptsignatureassistant.cpp M +8 -0 languages/clang/tests/test_assistants.cpp http://commits.kde.org/kdevelop/95e7dd4e07adcd3cd29a2d998fb4076b80746c11
@ Piotr: Regarding the whitespace changes, when you have setup the source formatter, it should use the correct style. If that is not the case, please report a new bug for that. Thanks
@Milian: Yes. Some times ago I configured "Source formatter" with my own formatter. You mentioned me about this when I reported different bug. I found some bug related with this function and soon I'm going to report it.
And BTW. I'm not sure if this is correct approach to use "Source formatter" in functions: "Adapt signature" or/and "Update declaration signature". Here I was confused, because I thought that "Source formatter" is used only in options: "Edit->Reformat source" and "Edit->Reformat line" :-/. What if I would like to have different formatting in header of function declaration and different in code (body of function). For example I would like to format default parameter in header of function declaration like this: "void foo( bool param=true)", and in body of function I like such format: "bool localParam = false". As you can see padding is different in both places. Now when I use option: "Edit->Reformat source" then one of them will be broken :-(. In this moment I have to use same formatting every where. I like such format: "void foo( bool param=true)", because this takes less space in row. This if of course is not problem when I have wide monitor or break line on every parameter.