[clangd-dev] Specifying format style using command line option

Dovod Dovodov via clangd-dev clangd-dev at lists.llvm.org
Sat Mar 23 02:39:11 PDT 2019

Hello guys.
This is my first attempt to contribute to clangd, so I hope for your

Clangd by default tries to use .clang-format file to format code. Since
"Format as you type" is experimental feature, it may be unusual for people
like me who are used to format code before commit or using some
keybindings. And personally I have some discomfort when my editor tries to
do too much things when I'm typing.
So here's a patch which adds a new command line option to control
formatting style. Using it I can pass "-clang-format-style={DisableFormat:
true, SortIncludes: false}" and clangd will not apply any formatting to my
code. Since there's "-clang-tidy-checks" for clang-tidy, it looks
reasonable to have the same option for clang-format.
Will be grateful for any feedback, thank you very much!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/clangd-dev/attachments/20190323/36cd3eb0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FormatStyle.patch
Type: text/x-patch
Size: 1168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/clangd-dev/attachments/20190323/36cd3eb0/attachment-0001.bin>

More information about the clangd-dev mailing list