Provides formatting and basic error diagnostics for BACI C-- (*.cm) files.
Install from VS Code Marketplace →
From VS Code Marketplace:
- Open VS Code → Extensions (Ctrl+Shift+X) → Search "BACI C--" → Install
From Command Line:
code --install-extension robertbiv.baci-vscodeManual Install (Offline):
- Download the latest
.vsixfrom GitHub Releases - Install via command line:
code --install-extension baci-vscode-0.1.0.vsix
- Or in VS Code: Extensions →
...menu → Install from VSIX
- Syntax highlighting (basic TextMate grammar)
- Diagnostics for common BACI rules:
main()must be last function- For-loop index cannot be declared in header
- Only supported types (int, char, string, semaphore, binarysem)
- String declarations require explicit length (
string[20] name;) - Nested
cobeginblocks not allowed
- Formatter: normalizes spaces around operators, indents braces C-style.
- Open a
.cmfile; diagnostics show in Problems panel. - Run
Format Documentor the commandBACI: Format Document.
# In the extension root
npm install
npm run build
# Press F5 in VS Code to launch Extension Development Host- Open
samples/test.cmin the Extension Host. - Check the Problems panel and use Quick Fix lightbulbs on:
- String length declaration (
string name;→string[20] name;). - For-loop header index declaration moved out.
binarysemandsemaphoreinvalid init values.- Nested
cobeginblock. main()not last.
- String length declaration (
- Run Format Document to apply indentation and spacing.
baci.defaultStringLength: default used by string Quick Fix.baci.format.spaceAroundOperators: insert spaces around operators.baci.format.indentSize: indent width in spaces.