This workspace contains a minimal VS Code extension that formats IBM Embedded SQL statements inside C files (.sqc, .sqx) using a lightweight custom formatter.
Author: wy.an
Features
Maps .sqc, .sqC, .sqx to C language so C/C++ IntelliSense, hover, and Go to Definition keep working
Applies SQL grammar (source.sql) via injection inside EXEC SQL ...; blocks for SQL token coloring
Runs C formatting first (via clang-format by default), then applies SQL clause indentation for EXEC SQL blocks
Supports Format Document and Format Selection
Shows an SQC status-bar badge when the active editor is an .sqc/.sqx file
Adds an SQC file decoration badge for .sqc/.sqx files in the Explorer
If clang-format is not available in PATH, the extension automatically probes common Windows install paths (LLVM and Visual Studio LLVM toolchains) before falling back to SQL-only formatting.
Run in VS Code
Open this folder in VS Code.
Press F5 to run the extension in a new Extension Development Host window.
change publisher from local to your real publisher id
bump version as needed
Create a Marketplace publisher (one-time) in Visual Studio Marketplace.
Create an Azure DevOps PAT with Marketplace (Manage) permission.
Login with vsce:
npx vsce login <your-publisher-id>
Publish:
npm run publish:marketplace
or auto bump: npx vsce publish patch
Recommended Marketplace content checklist
Keep README.md updated with:
key features
settings (embeddedSqlCPrettier.*)
known limitations and behavior
Update CHANGELOG.md each release
Keep a clear license in LICENSE
Notes
This formatter is intentionally lightweight. It focuses on practical EXEC SQL readability: SQL keyword highlighting via grammar injection and clause-oriented indentation that keeps C nesting intact.