![visual studio code auto format extension visual studio code auto format extension](https://www.learnitweb.com/wp-content/uploads/2021/08/Format-on-Save-1-768x232.jpg)
To disable the auto - import feature, set the setting to 'none'. This feature is disabled in Visual Studio Code by default. VS Code only allow one Format Document extension for Javascript, so if you are using extensions have the same feature (i.e: Prettier), these extensions need to be disabled. The “Format On Save” feature allows your code to automatically be formatted every time you save it – note that an extension will later be installed for it function.
#VISUAL STUDIO CODE AUTO FORMAT EXTENSION HOW TO#
This article shows how to auto-format code in Visual Studio Code. You can disable this behavior by setting editor.formatOnSave to false for the go.
![visual studio code auto format extension visual studio code auto format extension](https://vs-publisher-599079.gallerycdn.vsassets.io/extensions/vs-publisher-599079/codeformatter/5.6/1584793525643/273859/1/DefaultSettings.png)
By default, formatting is run when you save your Go file.
![visual studio code auto format extension visual studio code auto format extension](https://vs-publisher-599079.gallerycdn.vsassets.io/extensions/vs-publisher-599079/codeformatter/5.6/1584793525643/273854/1/ContextMenuForSolution.png)
While auto-formatting is not an in-built feature of Visual Studio Code, you can install a free extension that allows you to do this. You can format your Go file using F (Windows Shift+Alt+F, Linux Ctrl+Shift+I) or by running the Format Document command from the Command Palette or the context menu in the editor. It allows us to tidy up our code every time we save the changes, saving time and enhancing your workflow. Auto-formatting a code helps us to automatically make our code more readable and consistent.