Bug 358801

Summary: Formatter removes all white characters placed between type of function and its name
Product: [Developer tools] kdevplatform Reporter: Piotr Mierzwinski <piotr.mierzwinski>
Component: sourceformatterAssignee: kdevelop-bugs-null
Status: RESOLVED NOT A BUG    
Severity: normal CC: piotr.mierzwinski
Priority: NOR    
Version First Reported In: 4.90.91   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Piotr Mierzwinski 2016-01-30 22:42:35 UTC
In formatter configuration there is not option to configure whether formatter should or not remove spaces between type of function and its name. I mean "Other->Padding" box. And default behaviour is removing every white character from this place. Example. 

Padding configuration as following: 
  Pad parenthesis: "Inside only"
  Add spaces after parenthesis headers: "Checked"  (tested also with "Not checked")
  Add spaces around operators: "Not checked"

Declaration (header file):
	void       foo( bool param );

Definition (cpp file):
void MyClass::foo( bool param )
{
	if (param)
		;
}

Being in definition I add new parameter, for example "bool a" in header of definition of function, so result would looked like this: "void MyClass::foo( bool param, bool a )".
"Update declaration signature" pops up and after pressing "Alt+1" I get following modification in header file:
	void foo( bool param, bool a );

As you can see the spaces placed between type of function and its name disappeared.

Reproducible: Always

Steps to Reproduce:
1. Having function with default setting parameter add new one in definition of function
2. In "Update declaration signature" press Alt+1


Actual Results:  
	void foo( bool param, bool a );


Expected Results:  
	void       foo( bool param, bool a );


KDevelop, KDevplatform cloned at 30.12.2016 (at evening) from 5.0 branch.

I observed also some strange behaviour with automatically invoking of "Update declaration signature". Namely when I rolled back my changes in this way:
header file: Ctrl+Z, F5 (refresh)
cpp file: Cltr+Z, F5 (refresh)
then when I tried add new parameter again in definition of function header like described above. I observed that "Update declaration signature" is popping up just after when I finish type of parameter type, so here it's "bool" and when I put parameter name then nothing happened. I waited couple of minutes. It looks like "Update declaration signature" stopped work, because I tried do this also in different function in the same file. KDevelop restart helps.
Comment 1 Justin Zobel 2021-03-09 23:42:43 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 2 Piotr Mierzwinski 2021-03-10 20:28:11 UTC
In the newest KDevelop (5.6.2) mentioned function is still missing. Nevertheless I consider this as very minor issue and just close this bug report.