CLion Moves Class Declaration to Beginning of Line when Inheriting
Hello,
It seems that any time we write a class inside of a namespace, CLion works just fine. However, if we later inherit from other classes, it will move the class declaration to the beginning of the line. While this isn't a huge issue, it is exceedingly annoying to have to reformat the file each time we inherit from a class.
// This will format fine
namespace Example::ExampleTwo
{
class ExampleClass
{
public:
auto SomeFunction -> void;
private:
double SomeVariable;
}
}
// This will format fine
namespace Example::ExampleTwo
{
class ExampleClass : // <- The moment we add the : colon character, it moves this to the beginning
// of the line. It's extremely annoying.
{
public:
auto SomeFunction -> void;
private:
double SomeVariable;
}
}
Finishing inheriting from a class doesn't fix the issue. The only way to fix it is to either reformat the document by cutting and pasting everything or using the format tooling, or by manually indenting that line to where it should be.
Please sign in to leave a comment.