Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Accent Go FormatterNew to Visual Studio Code? Get it now.
Accent Go Formatter

Accent Go Formatter

Lemuel Adane

| (0) | Free
Configurable Go code formatter for Visual Studio Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Accent Go Formatter for Visual Studio Code

Accent Go Formatter is a VS Code-only formatter that applies configurable, AST-guided formatting rules to Go source. It uses Tree-sitter's Go grammar to understand blocks, parameter lists, argument lists, and import declarations. It does not call gofmt, goimports, or any other external formatter.

Installation

Build the VSIX with npm run package, then install it from a terminal:

code --install-extension accent-go-formatter-0.1.0.vsix

Or use VS Code's Extensions view and choose Install from VSIX....

Features

  • AST-guided document and selection formatting
  • Expand function parameter lists and calls with multiple arguments
  • Recursively format nested calls and Go blocks
  • Normalize operators, punctuation, and indentation
  • Organize standard-library and third-party imports
  • Preserve string, rune, raw-string, and comment contents
  • Optional format-on-save and format-on-change
  • Configurable profiles, block/continuation indentation, and line length

The default profile uses four-space block indentation, two-space continuations, and a 70-column preferred line length. Go-specific syntax and trailing commas are retained as required by the Go grammar.

Commands

  • Accent Go Formatter: Format Document
  • Accent Go Formatter: Format Selection
  • Accent Go Formatter: Organize Imports
  • Accent Go Formatter: Select Formatting Profile
  • Accent Go Formatter: Set as Default Go Formatter

Settings

{
  "accent.go.format.enabled": true,
  "accent.go.format.preset": "A Standard",
  "accent.go.format.tabSize": 4,
  "accent.go.format.continuationIndent": 2,
  "accent.go.format.insertSpaces": true,
  "accent.go.format.maxLineLength": 70,
  "accent.go.format.comments.enabled": true,
  "accent.go.format.imports.organizeOnFormat": true,
  "accent.go.format.onSave": false,
  "accent.go.format.formatOnChange": false
}

Google Go Style and Compact use two-space block indentation. Settings are available through the VS Code Settings UI or workspace settings.json.

Development

npm install
npm test
npm run compile
npm run package

The Go Tree-sitter grammar is copied into the compiled extension during npm run compile; users do not need a Go installation to format files.

License

MIT

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