Currently, the formatter pretty-prints function parameters and call arguments like
function verylongfunctionname(integer argumentname, integer argumentname,
integer argumentname, integer argumentname, integer argumentname, integer argumentname)
{ /* ... */ }
as
function verylongfunctionname(
integer argumentname,
integer argumentname,
integer argumentname,
integer argumentname,
integer argumentname,
integer argumentname
)
{ /* ... */ }
Hanging indentation could be supported easily by inserting a special marker directive during AST serialization before pretty-printing (or by adding a special flag to the arguments printing group to manage the state automatically inside the pretty-printer):
function verylongfunctionname(integer argumentname,
integer argumentname,
integer argumentname,
integer argumentname,
integer argumentname,
integer argumentname)
{ /* ... */ }
For me as a JavaScript fan, this convention that is mostly used in C/C++ codebases is not quite practical, but it may be a biased opinion.
Since C++ is heavily used within TTCN-3, adding an option to support hanging indentation may be nice to keep the styles consistent. Let me know if anyone would like to have it added.
Currently, the formatter pretty-prints function parameters and call arguments like
as
Hanging indentation could be supported easily by inserting a special marker directive during AST serialization before pretty-printing (or by adding a special flag to the arguments printing group to manage the state automatically inside the pretty-printer):
For me as a JavaScript fan, this convention that is mostly used in C/C++ codebases is not quite practical, but it may be a biased opinion.
Since C++ is heavily used within TTCN-3, adding an option to support hanging indentation may be nice to keep the styles consistent. Let me know if anyone would like to have it added.