Why does VSCode Clang-format stop formatting?

41 Views Asked by At

I am having a problem with clang-format in VSCode on my embedded 'C' project.

The sequence to failure is: Start VSCode and make edits to a header file and save it. Clang-format correctly fixes any formatting not matching the format file. If I continue editing the header file, each time I save it, clang-format works as expected. When I switch to a 'C' source file I cannot get clang-format to run at all, at least nothing is changed in the file. If I go back to the header file where it was working, clang-format no longer works there either.

The only way to get it working is the restart VSCode. Once restarted it behaves as described above.

If I edit and save the 'C' file first, the formatting of the header file does not work.

I have searched but not found a solution, I have also scrolled through the clang-format file, but see nothing that suggests it would have this effect.

0

There are 0 best solutions below