VS Code extension for sqformat, a code formatter for Squirrel with first-class support for the Respawn dialect used in Titanfall 2 and Apex Legends.
Features
- Formats
.nut and .gnut files on demand or on save
- Preserves all comments with automatic word-wrapping
- Intelligent line breaking: fits code on one line when possible, wraps cleanly when it doesn't
Before:
void function example(entity player) {
if (IsValid(player)) {
if (IsAlive(player)) {
player.SetMaxHealth(100)
}
}
}
After:
void function example(entity player) {
if ( IsValid(player) ) {
if ( IsAlive(player) ) {
player.SetMaxHealth(100)
}
}
}
Requirements
The sqformat binary must be installed and available on your PATH.
Install from source (requires Rust):
cargo install --git https://github.com/Bobbyperson/sqformat
Or download a pre-built binary from the latest release.
Usage
- Format document:
Ctrl+Shift+I
- Format on save: enable
editor.formatOnSave in your VS Code settings
Extension Settings
| Setting |
Default |
Description |
sqformat.executablePath |
"sqformat" |
Path to the sqformat binary. Set this if sqformat is not on your PATH. |
License
MIT
| |