Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>sqformatNew to Visual Studio Code? Get it now.
sqformat

sqformat

Bobbyperson

|
26 installs
| (0) | Free
Squirrel formatter and language support powered by sqformat
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

sqformat

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
  • Provides syntax highlighting without requiring semantic highlighting, with richer identifier classification when semantic highlighting is enabled
  • Reports lexer and parser errors as live editor diagnostics
  • Warns when a declaration reuses a name its own scope already binds, such as a local that hides a parameter
  • Warns when a member access names something a known struct or class does not declare
  • Warns when a call passes an argument count no declaration of its callee accepts
  • Warns when an initializer or return gives a value whose declared type it contradicts
  • Completes visible lexical declarations, indexed project globals, and members of explicitly typed classes and structs
  • Shows signatures and the active parameter while entering function, method, and constructor arguments
  • Provides document Outline, breadcrumbs, and workspace symbol search
  • Supports go-to-definition, hover details, find references, and rename
  • 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

No separate installation is required on supported platforms. The extension prefers an sqformat-lsp binary on your PATH and otherwise uses its bundled language server. The extension also bundles sqformat as the fallback formatter when the language server is disabled or fails to start.

Install from source (requires Rust):

cargo install --git https://github.com/Bobbyperson/sqformat sqformat
cargo install --git https://github.com/Bobbyperson/sqformat sqformat-lsp

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
  • Document symbols: Ctrl+Shift+O
  • Workspace symbols: Ctrl+T
  • Completion: type an identifier or press Ctrl+Space
  • Signature help: type ( or ,, or press Ctrl+Shift+Space
  • Go to definition: F12 or Ctrl+Click
  • Hover details: place the pointer over a symbol
  • Find all references: Shift+F12
  • Rename symbol: F2

Open the project folder rather than an individual file so workspace indexing can discover unopened .nut and .gnut files. Only declarations a file exports with global or globalize_all_functions are visible to other files; everything else at file scope stays local to its file. Code guarded by #if SERVER, #if CLIENT, or #if UI is understood as belonging to that VM, so completion and cross-file go-to-definition inside one guard skip declarations that only exist in another. A mod's mod.json extends that to whole files: a script's RunOn expression says which VMs it runs in, so editing a UI script does not offer server-only symbols. Scripts no manifest lists keep every VM available. Semantic highlighting classifies identifiers by what they resolve to, and dims code the file's VM cannot reach. Semantic analysis preserves independently valid top-level regions around parser, delimiter, invalid-character, and unterminated-string errors. Completion immediately after . and signature help inside an unfinished call use temporary parses. Member features support explicit nominal types, document-local anonymous inline structs such as struct { ... } file, static identifier/JSON table-literal slots, typedef aliases, class construction, declared method return chains, class inheritance with override shadowing, typed struct fields, and direct-call or expect Type(...) inference for local variables. A function that declares no return type has its return type inferred from the values it returns, when they all agree. Signature help also resolves named table methods, function/lambda expressions assigned to or reassigned into variables and structural slots, functionref-typed parameters, variables, and struct fields, and calls through a declared functionref return type. Source-order local aliases and reassignment retain value facts, existing structural slots update through =, and static property or literal-string slots inserted with <- become available after the insertion point, including slots that every branch of an if/else, ternary, or try/catch inserts, which become available after that construct. A call post-initializer such as Weapon() { ammo = 1 } contributes its slots beside the called type's own members. Dynamic computed keys, global/captured mutation, precise loop effects, and slots added with <- on a class instance are not resolved. Formatting uses the nearest .sqformat.toml above the file being formatted, or sqformat.configFile when that is set.

Extension Settings

Setting Default Description
sqformat.executablePath "" Optional formatter path or command. When empty, use sqformat from PATH, then the bundled formatter.
sqformat.configFile "" Optional path to a .sqformat.toml file. Without it, the nearest one above the file being formatted is used.
sqformat.advisoryLints false Enable the entity-use-after-yield and thread-spawned-inside-polling-loop advisory checks. Reload the window after changing it.
sqformat.languageServer.enabled true Enable diagnostics, language features, and formatting.
sqformat.languageServer.executablePath "" Optional language server path or command. When empty, use sqformat-lsp from PATH, then the bundled server.
sqformat.languageServer.apiSourceRoots [] Absolute external/native Squirrel source directories to index for completion, navigation, signatures, and type analysis. Reload after changing.

Packaging

Build the language server for the current host and stage it under bin/ before creating a platform-specific VSIX:

npm run bundle:server
npx @vscode/vsce package --target linux-x64

Release jobs can stage an already-built binary for the current host with npm run bundle:server -- /path/to/sqformat-lsp. Build each platform-specific VSIX on its matching release-matrix runner.

Pushing a tag that matches the extension version, such as v0.2.0, runs the release workflow. It builds the language server and downloads the formatter for Linux x64/ARM64, macOS x64/ARM64, and Windows x64, packages them into one universal VSIX, and attaches it to the GitHub release. Before tagging, replace the dummy SQFORMAT_TAG in .github/workflows/release.yml with the sqformat release tag to bundle.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft