[cfe-dev] ClangFormat Additional Options Proposal

Haroogan Haroogan at gmail.com
Tue Apr 29 09:14:59 PDT 2014


Hello Daniel,

Thank you for answering. OK, I might add it myself as time permits, although
I assumed that it would be quite simple to add for those who directly work
on ClangFormat given the framework that is behind.

Breaking after "::" is esoecially useful with class method definitions.
Don't have to go far to search for example, just look into Clang or LLVM
code base. A name of class could well be 40 characters long. If a method
name is around 20 characters, then you just have 20 characters left for
parentheses and parameters (assuming you've already wrapped return type
according to 1st proposed option). Of course you can wrap parameters, but
the point is that when you are scanning/looking through source code, the
"MyVeryVeryVeryVeryVeryUsefulSuperClass::" is irrelevant to you as you are
more interested in the name of method which is easier to track when it
starts from the beginning of line and not pushed to the middle of the line
by the "MyVeryVeryVeryVeryVeryUsefulSuperClass::". For the same reason GNU
decided to wrap return types. Why would we treat (routine-like in their
nature) class scope resolutions differently?

Regards,
Alexander



--
View this message in context: http://clang-developers.42468.n3.nabble.com/ClangFormat-Additional-Options-Proposal-tp4038901p4039163.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list