I have been using CoC for a few weeks now and I quite like it. Recently I started configuring the formatting options. I have put "coc.preferences.formatOnSave": true and configured .clang-format file inside my CPP project. Everything worked out of the box and my files were nicely formatted on each save.

I ran into a problem when I wanted to use a feature of clang-format-13 and the default version of clang-format on my system is 11. I looked throughout the CoC wiki and configuration options, and I couldn't find where exactly is the formatter command specified? I guess that running clang-format is a default option for cpp filetypes and that is why it worked out of the box, but I would like to change it so that clang-format-13 is run on each save.

Note: I know I could just symlink clang-format to clang-format-13, but I would like to know how is this handled by CoC under the hood.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.