From d53cd1992936dd5604b84cd4c02cfdfad4d9944a Mon Sep 17 00:00:00 2001 From: Joel Spadin Date: Sat, 22 Apr 2023 23:47:42 -0500 Subject: [PATCH] refactor: Add format on save for VS Code Added settings to format various file types on save in VS Code. Added some recommended VS Code extensions: - Prettier for formatting various file types - Python for formatting Python files - C/C++ for formatting C files - Devicetree for syntax highlighting - CMake for syntax highlighting --- .vscode/extensions.json | 9 +++++++++ .vscode/settings.json | 18 +++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000000..0819f71e7a0 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,9 @@ +{ + "recommendations": [ + "esbenp.prettier-vscode", + "ms-python.python", + "ms-vscode.cpptools", + "plorefice.devicetree", + "twxs.cmake" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index aea29cf0097..8bbff533a11 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,21 @@ "*.overlay": "dts", "*.keymap": "dts" }, - "python.formatting.provider": "black" + "python.formatting.provider": "black", + "[c]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "ms-vscode.cpptools" + }, + "[javascript][javascriptreact][typescript][typescriptreact]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[python]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "ms-python.python" + }, + "[css][json][jsonc][html][markdown][yaml]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + } }