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)
- Faster feedback while writing SaC code
- Clear diagnostics integrated into the editor
- Flexible compiler execution (
local,wsl,docker)
SaC keywords, operators, comments, and language constructs are highlighted out of the box.
Diagnostics from sac2c are shown as VS Code Problems and inline squiggles.
Choose how diagnostics are displayed:
expandedsmarthybrid
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.
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
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.
- Install the extension.
- Open a
.sacfile. - Ensure diagnostics mode is enabled (for example
onSave). - Configure compiler path/backend if needed.
int main() {
return 0;
}
Create a small typing or semantic error in a .sac file and save to see diagnostics in the Problems panel.
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
- 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
Issues and feature requests are welcome:


