Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>glaser-code-formatterNew to Visual Studio Code? Get it now.
glaser-code-formatter

glaser-code-formatter

palsch

|
8 installs
| (0) | Free
Code formatter that puts similar code tokens in the same column, making it easier to read and understand blocks of lines with similar code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

glaser-code-formatter

VS Code formatter focused on readability in dense code blocks. It optimizes horizontal spacing so related tokens line up across nearby lines.

Why use it

  • Faster scanning: repeated structures become visually comparable at a glance.
  • Better diffs: intent-focused changes are easier to spot when columns are aligned.
  • Safer formatting: only spacing is changed, code logic stays untouched.
  • Practical workflow: format full files or only selected line ranges.

Supported languages: Bash, C, C++, C#, CSS, Go, HTML, Java, JavaScript, JSON, Lua, PHP, Python, Ruby, Rust, TypeScript, TSX, XML, YAML.

Examples

JavaScript (token alignment)

Before:

export function neoWarn(...message) { (window.NeoLogWarnError?.neoWarn || console.warn)(...message); }
export function neoError(...message) { (window.NeoLogWarnError?.neoError || console.error)(...message); }

After:

export function neoWarn(...message)  { (window.NeoLogWarnError?.neoWarn  || console.warn)(...message); }
export function neoError(...message) { (window.NeoLogWarnError?.neoError || console.error)(...message); }

PHP (column alignment in control flow)

Before:

if (str_ends_with($json_string, "false")) { $parsed_json = false; $json_start_index = $length - strlen("false"); }
else if (str_ends_with($json_string, "true")) { $parsed_json = true; $json_start_index = $length - strlen("true"); }
else if (str_ends_with($json_string, "null")) { $parsed_json = null; $json_start_index = $length - strlen("null"); }
else if (\NeoGlobal\preg_match_better('/(-?\d+\.\d+)$/', $json_string, $matches)) { $parsed_json = json_decode($matches[1]); $json_start_index = $length - strlen($matches[1]); }
else if (\NeoGlobal\preg_match_better('/(-?\d+)$/', $json_string, $matches)) { $parsed_json = json_decode($matches[1]); $json_start_index = $length - strlen($matches[1]); }

After:

if      (str_ends_with($json_string, "false")) { $parsed_json = false; $json_start_index = $length - strlen("false"); }
else if (str_ends_with($json_string,  "true")) { $parsed_json = true;  $json_start_index = $length - strlen("true"); }
else if (str_ends_with($json_string,  "null")) { $parsed_json = null;  $json_start_index = $length - strlen("null"); }
else if (\NeoGlobal\preg_match_better('/(-?\d+\.\d+)$/', $json_string, $matches)) { $parsed_json = json_decode($matches[1]); $json_start_index = $length - strlen($matches[1]); }
else if (\NeoGlobal\preg_match_better('/(-?\d+)$/',      $json_string, $matches)) { $parsed_json = json_decode($matches[1]); $json_start_index = $length - strlen($matches[1]); }

Commands

  • Glaser: Format Current File
  • Glaser: Format Selected Lines
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft