Shave FormatShave Format is an opinionated formatter and linter for VS Code. It bundles a native formatter with one formatting preference: line width. InstallationInstall Shave Format from the Extensions view, or enter this in Quick Open:
The extension runs in trusted workspaces and supports Quick startRun Format Document from the Command Palette, or use the default shortcut: Set the default formatter and enable format on save in
Only whole documents are formatted; set Place these editor settings inside a language block to apply them only to that language. Supported languagesC, C++, C#, Java, Go, Rust, Kotlin, Swift, PHP, JavaScript (JSX), TypeScript (TSX), Ruby, Python, JSON (JSONC), HTML, and CSS (SCSS). Settings
Line width measures code length rather than visual display width; indentation and separately handled comments do not count toward the limit. Long strings and other indivisible content may exceed it. FormattingFormatting is not limited to whitespace: it can also rewrite eligible syntax, merge or split declarations, sort supported named imports, make eligible trailing returns explicit, and insert or synchronize documentation comments for functions, except in Python. Transformations require their semantic conditions to be established. Review the resulting changes before committing them. Comment text is rewritten to one sentence per logical line without sentence-ending periods, and comment notation may be converted; this also applies to file headers such as license notices. Diagnostics and limitsReview and skip diagnostics use Information severity; violations and document-specific formatting failures use Warning severity, except parser initialization failures (Error). Installation failures are Error notifications; temporary startup resource shortages are Warning notifications. When too many formatting requests are queued, or startup fails, details appear only in notifications and Output. Warnings appear in Problems at positions in the formatted document after edits are applied. Open View → Output and select Shave Format for notices, skip reasons, and errors. Positioned notices appear as related information in Problems, or as Information when no matching diagnostic exists. A document-wide skip and its following remedy share the first-line range. Diagnostics do not certify compliance with every coding rule. Partial formatting leaves unreadable regions unchanged and reports a warning; an input with no formattable region is skipped. Failed, skipped, cancelled, or outdated results are not applied. Successful formatting uses LF for generated lines while preserving protected content. CRLF documents switch to LF on successful formatting; output that mixes LF with preserved CR inside literals is not applied. Each UTF-8 input is limited to 16 MiB. Each parse has the native formatter's time limit. One request runs at a time; formatting requests are queued in order within a 16 MiB total input. If too many formatting requests are queued, they are not applied; format again after current requests finish. Requests that exceed parsing or input limits are also not applied. HelpFormatting was not applied: <reason>. means the formatter reported a failure. The document is left unchanged; this does not diagnose an input style violation. Failures appear as a first-line diagnostic in Problems; skips say Formatting was skipped: <reason>. Problems shows the cause, with remedies in related information; notifications include both. Use Show Output for details. For a skip with a source location, choose Show Problems to open the corresponding diagnostic. Report Issue opens a report for Shave Format with only the fixed reason as its title; it does not insert source text. Review the report before sending it. Installation errors name the required Shave Format package (for example, Don't Show Again is available only on the CRLF-to-LF information notice. Set |