It took me some times to understand how to format only on save on visual studio. Here are the steps for posterity:
- Install extension « format on save »
- Disable all the automatic formating options (« Automatically format X when I type Y »)
- Set « ClangFormat execution » to « Run ClangFormat only for manually invoked formatting commands »
The 3rd one is the most obscure. Without it, formatting will continue to happen, randomly making your cursor jump in the middle of a sentence because formatting occured and the file changed under your feet. 😉
Laisser un commentaire