Astyle format a cpp2 file automatically in VS Code?

138 views Asked by At

Using Astyle extension with VS Code. I can format a cpp2 file with Ctrl+Shift+I.

How can I have the formatting happen automatically at other times such as a text paste or file save?

Installed:

1

There are 1 answers

0
CW Holeman II On BEST ANSWER

According to User and Workspace Settings in settings.json add:

"[cpp2]": {
    "editor.defaultFormatter": "chiehyu.vscode-astyle",
    "editor.formatOnSave": true,
},

which applies the formatting when the file is saved.