Skip to content

Commit

Permalink
Explain VSCode formatter (FuelLabs#3389)
Browse files Browse the repository at this point in the history
The `editor.defaultFormatter` global VSCode setting is often set to a
cross-language formatter like Prettier.

To remind the reader of this, I have added a note in "The Fuel
Toolchain" about how to override this setting for Sway files.

Note: this PR depends upon FuelLabs#3388 being merged first.

Co-authored-by: Mohammad Fawaz <[email protected]>
Co-authored-by: Joshua Batty <[email protected]>
  • Loading branch information
3 people authored Nov 30, 2022
1 parent 4b6f6d5 commit d97363a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/src/introduction/fuel_toolchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ A canonical formatter is provided with `forc-fmt`. [Installation instructions](.
forc fmt
```

The [Visual Studio Code plugin](https://marketplace.visualstudio.com/items?itemName=FuelLabs.sway-vscode-plugin) will automatically format Sway files with `forc-fmt` on save.
The [Visual Studio Code plugin](https://marketplace.visualstudio.com/items?itemName=FuelLabs.sway-vscode-plugin) will
automatically format Sway files with `forc-fmt` on save, though you might have to explicitly set the Sway plugin as the
default formatter, like this:

```json
"[sway]": {
"editor.defaultFormatter": "FuelLabs.sway-vscode-plugin"
}
```

## Fuel Core (`fuel-core`)

Expand Down

0 comments on commit d97363a

Please sign in to comment.