Synx for Visual Studio Code
Language support for Synx, a
compiled language with ownership and borrowing, C-style syntax, and a
self-hosted compiler.
Features
- Syntax colors for
.snx files, including string interpolation
("sum {a + b}"), nested block comments, and /// doc comments.
- Comment toggling, bracket matching, auto-closing pairs, and indentation.
- Snippets:
main, fn, struct, enum, trait, impl, if,
ifelse, for, foreach, while, loop, match, matchopt,
matchres, import, and print.
- Compiler errors in the editor. The extension runs
synx check when you
open or save a file. Errors in imported files show on those files.
- Synx: Run File and Synx: Build File run the compiler in the
terminal panel. The Run and Build buttons are in the editor title bar.
- Synx: Check File checks the current file.
- The status bar shows the compiler version. When the compiler is not
found, it shows a warning; select it to download Synx or to set the path.
Requirements
Install Synx from the
releases page. The
extension finds the compiler in this order:
- The
synx.compilerPath setting.
- The
SYNX_HOME environment variable.
PATH.
- The default install folder:
%LOCALAPPDATA%\Programs\Synx on Windows,
~/.local/share/synx on Linux and macOS.
Synx 0.1.0 works. Later releases write the errors as JSON
(synx check --json), which gives exact error ranges.
Settings
| Setting |
Default |
Effect |
synx.compilerPath |
empty |
Path to synx, synx.cmd, or synx.exe. Empty uses the search order above. |
synx.checkOnSave |
true |
Check a file when you save it. |
synx.checkOnOpen |
true |
Check a file when you open it. |
synx.buildArguments |
[] |
Extra arguments for Run and Build, for example ["--release"]. |
Commands
| Command |
Effect |
| Synx: Run File |
Saves the file, then runs synx run <file>. |
| Synx: Build File |
Saves the file, then runs synx build <file>. The executable is written beside the file. |
| Synx: Check File |
Saves the file, then shows its errors. |
| Synx: Show Output |
Shows the extension log: the compiler path and check failures. |
License
MIT or Apache-2.0, at your option.
| |