SaC Language Support
May 11, 2026 ยท View on GitHub
SaC Language Support adds first-class editing support for SaC (Single Assignment C) in Visual Studio Code.
It provides:
- SaC language registration for
.sacfiles - Syntax highlighting and language configuration
- Compiler-backed diagnostics via
sac2c(Problems panel + editor squiggles)
Why Use This Extension?
- Faster feedback while writing SaC code
- Clear diagnostics integrated into the editor
- Flexible compiler execution (
local,wsl,docker)
Features
1. Syntax Highlighting
SaC keywords, operators, comments, and language constructs are highlighted out of the box.

2. Compiler Diagnostics in Editor
Diagnostics from sac2c are shown as VS Code Problems and inline squiggles.

3. Configurable Diagnostic Presentation
Choose how diagnostics are displayed:
expandedsmarthybrid

4. Formatter and Local Rules
SaC formatter supports document/range formatting, optional format-on-save, and workspace-local .sac-format files with syntax highlighting and hover tooltips.
Formatting precedence is:
- VS Code settings under
sac.format.* - nearest
.sac-format - built-in defaults
Use the command "SaC: Generate Default .sac-format File" to scaffold a .sac-format in your workspace root.
See docs/formatting.md for supported keys and configuration.
Requirements
Syntax highlighting works without external tools.
For diagnostics, sac2c must be available through one of:
sac.compiler.path(explicit executable path)- bundled compiler in
vendor/sac2c/<channel>/<platform-target>/ - system
sac2conPATH
Supported execution backends:
localwsl(Windows host only)docker
Extension Settings
Common settings:
sac.languageServer.enablesac.features.languageServer.enablesac.features.formatter.enablesac.features.outline.enablesac.features.commands.enablesac.features.chatParticipant.enablesac.diagnostics.mode(onSave,onType,manual)sac.diagnostics.presentation(expanded,smart,hybrid)sac.diagnostics.includeRelatedInformationsac.diagnostics.includeStackInMessagesac.diagnostics.maxStackFramessac.diagnostics.workspaceScan.enabledsac.compiler.channel(stable,develop,system)sac.compiler.pathsac.compiler.executionBackend(local,wsl,docker)sac.compiler.extraArgssac.format.enablesac.format.onSavesac.format.indentSizesac.format.normalizeGuardssac.format.expandInlineWithLoopssac.format.expandInlineComprehensionssac.format.splitInlineGuards
Workspace formatter file:
.sac-formatwithIndentSize,TabWidth,NormalizeGuards,ExpandInlineWithLoops,ExpandInlineComprehensions,SplitInlineGuards
Default structured messaging args:
-cti-no-color -cti-no-source -cti-no-hint -cti-no-explain -cti-message-length 0 -cti-primary-header-format "%s: " -cti-continuation-header-format "%.0s"
If your sac2c version uses different flags, override sac.compiler.messaging.args.
Quick Start
- Install the extension.
- Open a
.sacfile. - Ensure diagnostics mode is enabled (for example
onSave). - Configure compiler path/backend if needed.
Examples
Minimal SaC file
int main() {
return 0;
}
Trigger diagnostics
Create a small typing or semantic error in a .sac file and save to see diagnostics in the Problems panel.
Windows Notes
If you are on Windows and do not have a native sac2c binary, recommended options are:
- Use VS Code Remote WSL and run backend
localinside WSL - Use backend
wsl - Use backend
docker
Documentation
- Diagnostics pipeline:
docs/diagnostics-pipeline.md - Editor-agnostic diagnostics notes:
docs/editor-agnostic-diagnostics.md - Copilot plugin and AI extension integration:
docs/copilot-plugin.md - Support:
SUPPORT.md - Contributing:
CONTRIBUTING.md
Feedback
Issues and feature requests are welcome: