<div dir="ltr">Hi,<div>Clang-format was lacking an option to add indentation within namespaces.</div><div>I've created a patch that adds this option to clang::Format::FormatStyle.</div><div>There is also a basic test.</div>
<div>You'll find it in the attachment.</div><div><br></div><div>I think it will be nice to have a possibility to indent only the content of namespaces, but excluding the inner namespaces, i.e. to have something like:</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">namespace outer {<br> class Indented1;<br>namespace inner1 {<br>
class Indented2;<br>} // namespace inner1<br>namespace inner2 {<br>} // namespace inner2<br>} // namespace outer</blockquote><div><div><br></div><div>instead of: </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
namespace outer {<br> class Indented1;<br> namespace inner1 {<br> class Indented2;<br> } // namespace inner1<br> namespace inner2 {<br> } // namespace inner2<br>} // namespace outer</blockquote><div><div><br></div>
<div>Regards,<br>Marek</div>
</div></div></div>