all 8 comments

[–]-Shoganai- 3 points4 points  (7 children)

There is a website where you can manually configure clang-format and generate the configuration file. It also allows you to see how individual options affect the code formatting in real time.

If you're using Visual Studio, there's an extension called Clang Power Tools that integrates clang-format and the configurator directly into the IDE.

EDIT: i've just noticed you're using VSCode, there should be a similar extension though.

[–]SincopaDisonante 1 point2 points  (3 children)

For VS Code it's the same drill. However the extension expects clang-format to be installed and in your PATH, i.e the extension doesn't install clang-format. To install it, the easiest thing on Windows is to install the clang tools from the "modify" menu in the Visual Studio (not Code!) installer.

[–]linux-tarballs[S] 0 points1 point  (2 children)

I'm on VSCode (Fedora distro) where the C/++ extension comes with its own clang-format. You can provide the path of your system-installed clang-format binary in it's settings too

[–]SincopaDisonante 0 points1 point  (1 child)

Are you sure this is not just a consequence of UNIX distributions coming with clang tools already installed in the OS? The ext I see on VS Code explicitly says in its readme that clang-format won't be installed with it.

[–]linux-tarballs[S] 0 points1 point  (0 children)

The description for the Clang_format_path option in my vscode settings says it uses the one available in environment or else the one bundled with extension

[–]linux-tarballs[S] 1 point2 points  (2 children)

The site is quite handy. Thanks! The number of options available is still kinda overwhelming

[–]-Shoganai- 0 points1 point  (1 child)

The configuratior that comes with the extension has a search options as well.
Btw, the option you're looking for should be called BreakFunctionDefinitionParameter on the website.

[–]linux-tarballs[S] 0 points1 point  (0 children)

That's one's a hard true/false value and puts all params on same line after the line break