|
|
VS Code language support for SaC (Single Assignment C), including a minimal language server for compiler-backed diagnostics.
This extension now includes:
- SaC language registration (
.sacfiles) - SaC syntax highlighting and language configuration
- Compiler-backed diagnostics via
sac2c(Problems panel + red squiggles)
This repository is currently set up as a development extension project.
- Install dependencies:
npm install-
Open this folder in VS Code.
-
Run the extension in a Development Host window:
- Press
F5in VS Code.
- Open any
.sacfile and verify syntax highlighting is active.
For syntax highlighting only, no external tool is required.
For diagnostics, sac2c is required via one of:
sac.compiler.path(explicit executable path)- bundled compiler in
vendor/sac2c/<channel>/<platform-target>/ - system
sac2conPATH
Execution backends:
local: runsac2cdirectly on the host where the extension runswsl: run viawsl.exe(Windows host only)docker: run viadocker runwith bind mount
The extension does not auto-install or auto-start WSL/Docker.
Main settings:
sac.languageServer.enablesac.diagnostics.mode(onSave,onType,manual)sac.compiler.channel(stable,develop,system)sac.compiler.pathsac.compiler.executionBackend(local,wsl,docker)sac.compiler.wsl.distributionsac.compiler.docker.imagesac.compiler.docker.runArgssac.compiler.messaging.enabledsac.compiler.messaging.argssac.compiler.extraArgssac.compiler.fallbackToSystem
Default structured messaging args are:
-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 a different syntax, override sac.compiler.messaging.args.
sac2c is typically Linux/macOS-first. For Windows users, recommended options are:
- Use VS Code Remote WSL and run this extension inside WSL with backend
local - Use backend
wsland configuresac.compiler.wsl.distribution - Use backend
dockerand setsac.compiler.docker.image
If none are available, keep syntax highlighting enabled and diagnostics disabled.