Bug 287158

Summary: Indentation preferences are not respected on methods autocompletion
Product: [Applications] kdevelop Reporter: Detlev Casanova <detlev.casanova>
Component: Language Support: CPP (old)Assignee: kdevelop-bugs-null
Status: CONFIRMED ---    
Severity: normal CC: craftplace.ms, kde
Priority: NOR    
Version First Reported In: 4.2.3   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Detlev Casanova 2011-11-21 13:27:49 UTC
Version:           4.2.3 (using KDE 4.7.3) 
OS:                Linux

I have a configuration that makes indentation as follow : tabs of width 8.
When I type the first letters of a method in a cpp file which is declared in the header, KDevelop proposes to autocomplete it and it does it by typing enter.

So far, so good. The problem is that, if the class in which the method inherits from a class which already implements the method, the autocompletion will put in the function something like
return Parent::method();

and it will be, in my case, indented with 4 spaces, not with a tab.

This also happens when autocompletion writes a virtual method declaration in a subclass of a class declaring that virtual method as :
virtual T method() = 0;

The autocompletion will add it with an indentation of 4 spaces, not a tab.

Is that normal ?

Reproducible: Always

Steps to Reproduce:
See the bug details but it is reproducible with this :
1) Set an indentation with one tab in the preferences.
2) Write this code :
class Indent
{
public:
	Indent();
	~Indent();

	void method() = 0;
};
class Child : public Indent
{
public:
	Child();
	~Child();

	//Type "method" here and use auto-completion...
};

Actual Results:  
The autocompleted method is indented with 4 spaces.

Expected Results:  
The autocompleted method should be indented with a tab, not 4 spaces

I can provide any needed additionnal information on demand.
Comment 1 Aleix Pol 2013-03-31 01:39:33 UTC
It's C++ things, so put it under C++
Comment 2 Andrey Cygankov 2016-01-23 23:48:24 UTC
I tried to check the bug in KDevelop 5 and had problems.
http://i.imgur.com/2mfhRxN.png
Perhaps the bug is still present.
Comment 3 Justin Zobel 2021-03-09 22:48:12 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.