VS Code extension with bundled formatters. It can format supported files on save without installing any other VS Code formatter extension, automatically with default settings.
Version 1.0.5 upload fix
- Resize the original logo to 512x512 pixels and check PNG dimensions during packaging.
Version 1.0.4 upload fixes
- Portable
icon.png path for Marketplace packaging.
- Losslessly compressed icon below 1024 KB; original image pixels preserved.
- Package verification enforces icon size and portable archive paths.
Version 1.0.2 changes
- Format on save enabled by default for supported language modes, without pasting settings.
- Discard stale formatting when the document changes during parsing.
- Read scope and JSON preferences for the active document's workspace folder.
- Publish the supplied logo as the Marketplace icon.
- Expanded all 12 language formatter tests, repeat-format stability and failure guards.
Version 1.0.1 changes
- Bundled Prettier for JavaScript, JSX, TypeScript, TSX, HTML, CSS, SCSS, Less, JSON, and JSONC.
- Bundled Prettier PHP plugin for pure PHP Laravel controllers, models, routes, etc.
- Bundled Chisel (
prettier-plugin-blade) for *.blade.php views. Filename detection works even when VS Code labels a Blade file as PHP.
- VS Code document formatting + range formatting providers. Blade range formatting is intentionally unavailable; full-document formatting is supported.
- Default formatter is set to
hamzadev.codecraft-pro for supported language modes only where a user/workspace override doesn't already exist.
- Existing format commands, JSON pretty/minify, bracket scope, Go to Definition, Find References, and other settings are retained.
Limits: This is not a universal formatter for every programming language. The PHP parser deliberately skips mixed PHP/HTML files because the upstream PHP plugin does not consider them stable. Blade views use a dedicated Blade formatter instead. Formatter results may use style conventions different from Laravel Pint; inspect diffs before using on real projects. This extension does not auto-update Laravel/Pint/Composer configuration or install tools into user projects.
Install CodeCraft Pro and save a supported file. CodeCraft contributes language-specific defaults enabling format on save and selecting its bundled formatter. Existing explicit language-specific user/workspace settings take precedence; use VS Code Settings UI to choose CodeCraft if you previously selected another formatter or disabled format on save for that language. Language-specific defaults can take precedence over generic editor settings. No settings are written by the extension.
Supported modes: JavaScript, JSX, TypeScript, TSX, pure PHP, Blade, HTML, CSS, SCSS, Less, JSON, JSONC. This release does not format Python, C/C++, Java, Go, Rust or other unsupported languages.
Build and publish (Mac)
Node.js 22 LTS recommended for building; VS Code 1.96+ required (Node 20 extension runtime). Publisher: hamzadev.
Run from the extracted project directory:
npm install
npm run check
npm test
npm run audit:prod
npm run package
npm test runs 39 mocked/unit tests and real formatter smoke tests for JSX,
TypeScript, PHP, Blade, HTML, CSS, and JSON. It requires npm install.
The Blade implementation changed from blade-formatter to Chisel v3; expect
some formatting differences. Review Git diffs before formatting valuable code.
npm run audit:prod fails on moderate or more severe runtime vulnerabilities.
Do NOT use npm audit fix --force blindly. If the audit reports issues,
resolve them and rerun the full suite before publishing.
npm run package builds a single JS release bundle, verifies formatting,
checks runtime vulnerabilities, and packages only the release bundle and
metadata. It uses --no-dependencies intentionally because npm dependencies
are already included in release/extension.js. No other VS Code formatter
extension is required. node_modules is excluded from the VSIX.
Before uploading, install the VSIX locally, open test React/Blade/PHP/HTML/CSS/JSON
files and verify Format on Save. Then update the existing Marketplace listing
with the v1.0.5 VSIX, rather than creating a second extension.
Development
npm run build — compile and create VS Code extension bundle
npm run check — type check with official VS Code types
npm test — unit tests plus real formatter integration smoke tests
npm run offline:test — limited offline typecheck using minimal fallback API and stubbed formatter engines
No code is sent to an external service by the extension. Formatting happens locally and returns in-memory edits to VS Code. Input syntax errors leave source unchanged. For files over codecraft.format.maxDocumentCharacters, formatting is skipped.
Other features
- JSON Pretty / Minify commands: parse and replace only valid JSON; invalid files remain untouched.
- Scope indicator: best-effort matching of
(), [], {} with configurable max file size, color and debounce.
- Navigation: delegates definition/references commands to VS Code's installed language tooling.
- Format Document / Selection: delegates to the active registered VS Code formatting provider.
Build note (v1.0.1)
The extension entry stays CommonJS (release/extension.js) and the bundled formatter is loaded on demand as ESM (release/formatting.mjs) through a small bridge. npm run package runs real formatter smoke tests, a production dependency audit and VSIX verification before release.
Editor integration test
tests/editor-host.cjs is a VS Code extension test runner. Launch VS Code with an isolated --user-data-dir, an empty --extensions-dir, --extensionDevelopmentPath pointing to this folder and --extensionTestsPath pointing to the runner. It waits for workbench startup, then tests automatic formatting for all supported language modes, JSON tools, document/selection commands, JavaScript navigation and an explicit language-specific opt-out. It writes fixtures/results under the OS temporary directory, or CODECRAFT_TEST_OUTPUT when set. The tested VSIX itself contains no test runner or project dependencies.