Erlang Formatter for Visual Studio Code
FeaturesAuto format on SaveSetup1. Install the VSC extensionInstall the Erlang Formatter from the Visual Studio Marketplace from this link or by searching from the Extensions tab within the app itself. If you have trouble finding it search for 2. Install RebarFollow the official Rebar install instructions or use the commands below which will download rebar3 to a temporary directory and install it for your OS user.
Then add rebar3 to your PATH by putting it to your shell configuration file (for example
3a. Default formatter setupIf you just want to get up and running quickly, run the following command for a good default. Otherwise read the section below for more detail.
NOTE: The first time you format your code it might take a few seconds if rebar3 hasn't already downloaded the formatter plugin. 3b. Choosing a specific formatterThere are three main options for Erlang formatters right now. They are all written in Erlang and depend on rebar3. There's no community consensus on which to use, so you'll just have to pick one. Simply add the plugin to your project's
4. Extension configurationAdd the extension config to your preferences file.
NOTE: If you want to use another formatter just replace LinksThanksThanks to the authors of these projects, which were highly valuable resources. FormattersVisual Studio Code Extensions |