[cfe-dev] More clang-format options please ?

Björn Schäpers via cfe-dev cfe-dev at lists.llvm.org
Fri Dec 3 01:26:48 PST 2021


Hi,

Am 03.12.2021 um 00:08 schrieb Timothy Madden via cfe-dev:
> Hello,
> 
> Is it possible to add a clang-format option for the indent to use inside 
> preprocessing directives please ? So I could use an indent of 1 for the PP, and 
> 4 for the rest of the language

Something like PPIndentWidth 
(https://clang.llvm.org/docs/ClangFormatStyleOptions.html) ? :)

> #if defined(_DEBUG)
> # include "assertions.hh"
> #endif
> 
> Also is it possible please to add an option for indenting the template header ? 
> Similar to IndentRequires, but it would apply to the following line, so I can write:

Make a whish, Bugzilla (or GitHub?) and add me (HazardyKnusperkeks) or 
MyDeveloperDay. Maybe someone will take care of it.

> template <typename ElementT>
>      class vector
> {
>       // ...
> 
> and:
> 
> template <typename ArgT>
>      ArgT max(ArgT const &a, ArgT const &b)
> {
>      return a < b ? b : a;
> }
> 
> Next, could I also break on function call and function definition parentheses, 
> like I can brake on braces ? So I can write:
> 
> void loadContainerFromStorage
>      (
>          string   storageFileName,
>          Cont   &container,
>          size_t &container_size
>      )
> {
>      // ...

I think something like this is in work, you can look in phabricator: 
https://reviews.llvm.org/differential/query/q_PaOIrQOjwt/

> And then the same case for template arguments...
> 
> --
> Thank you,
> Timothy Madden
> 
> 

Kind regards,
Björn Schäpers.



More information about the cfe-dev mailing list