Uncrustify: how do I set the indentation of the initializer list and function arguments

I have been trying to get an indentation for the constructor which looks like this:

ClassName::ClassName(const std::string &id,
                     std::shared_ptr<AbstractInterface> object,
                     bool isDynamic) :
    m_id(id),
    m_object(object),
    m_isDynamic(isDynamic),
    m_state(ClassState::CREATED)
{
}

I want the arguments to be indented so they are aligned with the first parenthesis for the argument list, but the initializer list should be indented by 4 spaces (which is my regular indent size).

I have generated my uncrustify config from a code sample file which includes this code example. I have seen that I can use indent_ctor_init, but this is set to 0 in the generated config.

Is this the config option I should be using for the initializer list?

I also have not been able to find where to set the indentation for the arguments so I don't get a newline before the first argument.

This is what I am getting now:

ClassName::ClassName(
    const std::string &id,
    std::shared_ptr<AbstractInterface> object,
    bool isDynamic) :
    m_id(id),
    m_object(object),
    m_isDynamic(isDynamic),
    m_state(ClassState::CREATED)
 {
 }

Answers

I managed to find a solution. Not sure exactly which options were incorrect. I found another configutation file to start from and then changed the indent_continue option and the nl_func_decl_start (and possibly another I have forgotten) and now it looks as I want.

Posted on by thenor