This guide explains how to build, install, and use the ASUN VS Code extension.
- Requirements
- Build and Package
- Install the Extension in VS Code
- Verify the Installation
- Features and Usage
- Configuration
- FAQ
Before you begin, make sure the following tools are installed:
| Tool | Minimum Version | Purpose | Download |
|---|---|---|---|
| VS Code | 1.75+ | Editor | Download |
| Node.js | 18+ | Build the extension | Download |
| Zig | 0.15+ | Build the language server | Download |
| Git | recent | Clone lsp-asun automatically if missing |
Download |
Verify the installation from a terminal:
node --version
npm --version
zig version
code --version
git --versionIf code is not available in your shell, open VS Code and run Shell Command: Install 'code' command in PATH.
The build script does the following:
- Installs npm dependencies for the extension
- Compiles the TypeScript extension code
- Builds the
lsp-asunlanguage server with Zig - Bundles the binary into
server/ - Packages a platform-specific
.vsix
npm install -g @vscode/vscecd plugin_vscode
npm install
./scripts/build.sh currentThis produces a .vsix file in the current directory, for example:
asun-vscode-darwin-arm64-0.1.0.vsix
./scripts/build.sh allThis generates six VSIX packages:
| File | Platform |
|---|---|
asun-vscode-darwin-arm64-0.1.0.vsix |
macOS Apple Silicon |
asun-vscode-darwin-x64-0.1.0.vsix |
macOS Intel |
asun-vscode-linux-x64-0.1.0.vsix |
Linux x86_64 |
asun-vscode-linux-arm64-0.1.0.vsix |
Linux ARM64 |
asun-vscode-win32-x64-0.1.0.vsix |
Windows x86_64 |
asun-vscode-win32-arm64-0.1.0.vsix |
Windows ARM64 |
./scripts/build.sh darwin-arm64
./scripts/build.sh darwin-x64
./scripts/build.sh linux-x64
./scripts/build.sh linux-arm64
./scripts/build.sh win32-x64
./scripts/build.sh win32-arm64The extension build is cross-platform because:
- Zig can cross-compile
lsp-asunfor all supported targets vsce package --target ...produces target-specific VSIX packages- The packaged extension loads the bundled language server from
server/
If ../lsp-asun does not exist, ./scripts/build.sh clones it automatically from GitHub before building.
code --install-extension asun-vscode-darwin-arm64-0.1.0.vsixOr in VS Code:
- Open the Command Palette with
Cmd+Shift+Pon macOS orCtrl+Shift+Pon Windows/Linux - Run
Extensions: Install from VSIX... - Choose the matching
.vsixfile for your platform - Reload VS Code after installation
If you do not want to package the extension yet, you can run it directly in development mode.
Build the language server first:
cd ../lsp-asun
zig buildThen open the extension folder in VS Code:
code ../plugin_vscodePress F5 to launch a new Extension Development Host window.
In development mode the extension looks for the server in:
server/lsp-asun../lsp-asun/zig-out/bin/lsp-asunserver/asun-lsp../asun-lsp/asun-lspPATH
The legacy asun-lsp fallback is kept for compatibility, but lsp-asun is the primary server.
- Create a file named
test.asun - Paste the following content:
{name@str, age@int, active@bool}:
(Alice, 30, true)
- Confirm the following:
- Syntax highlighting is active
- There are no error diagnostics for valid input
- Inlay hints appear before tuple values
If syntax highlighting works but diagnostics or formatting do not, see the FAQ.
Syntax highlighting works automatically for .asun files.
Highlighted elements include:
- field names
- type annotations such as
@str,@int,@bool,@float - string, number, and boolean values
{}()[]- comments like
/* ... */
Fenced ASUN code blocks are highlighted in Markdown:
```asun
{name@str, score@int}:(Alice, 100)
```The extension shows real-time diagnostics while you edit.
For example, this input is invalid:
{name@str}:(Alice
VS Code should underline the error and show it in the Problems panel.
Format the current ASUN document into a readable layout.
Ways to run it:
Shift+Option+Fon macOS orShift+Alt+Fon Windows/Linux- Command Palette:
ASUN: Format (Beautify) - Editor context menu:
Format Document
Before:
{name@str,age@int,addr@{city@str,zip@int}}:(Alice,30,(NYC,10001))
After:
{name@str, age@int, addr@{city@str, zip@int}}:
(Alice, 30, (NYC, 10001))
Compress the current ASUN document into a compact one-line form.
Use the Command Palette and run ASUN: Compress (Minify).
Before:
{name@str, age@int}:
(Alice, 30)
After:
{name@str,age@int}:(Alice,30)
Open an .asun file, run ASUN: Convert to JSON, and the extension opens the converted JSON in a new editor tab.
ASUN input:
{name@str, age@int, active@bool}:
(Alice, 30, true)
JSON output:
{
"active": true,
"age": 30,
"name": "Alice"
}There are two ways to do this.
From a JSON file:
- Open a
.jsonfile - Run
ASUN: Convert JSON to ASUN - The converted ASUN opens in a new tab
From pasted input:
- Run
ASUN: Convert JSON to ASUN - Paste JSON content into the input box
- Press Enter
JSON input:
[
{ "name": "Alice", "score": 95 },
{ "name": "Bob", "score": 87 }
]ASUN output:
[{name@str,score@int}]:
(Alice,95),
(Bob,87)
Press Ctrl+Space to trigger completion suggestions while editing ASUN.
Typical suggestions include:
- top-level templates
- type names such as
int,str,bool,float - boolean literals like
trueandfalse
Hover over fields, type annotations, or values to see contextual information such as field type or node kind.
The extension can show field-name hints before tuple values.
Example source:
{name@str, age@int, city@str}:(Alice, 30, NYC)
Displayed with hints:
{name@str, age@int, city@str}:(name: Alice, age: 30, city: NYC)
The name:, age:, and city: labels are visual hints only. They are not part of the file content.
The extension provides semantic highlighting for different token categories:
| Element | Semantic Type |
|---|---|
{} () [] |
keyword |
@int, @str, etc. |
type |
| field names | variable |
| string values | string |
| numbers | number |
| comments | comment |
: , |
operator |
true false |
parameter |
Search for asun in VS Code settings.
| Setting | Type | Default | Description |
|---|---|---|---|
asun.lspPath |
string | "" |
Path to the language server binary. If empty, the extension auto-detects it |
asun.inlayHints.enabled |
boolean | true |
Whether to show field-name inlay hints |
If the server binary is not in a default location, set an absolute path in your VS Code settings:
{
"asun.lspPath": "/Users/your-name/code/lsp-asun/zig-out/bin/lsp-asun"
}The language server probably did not start correctly.
Try the following:
-
Check whether the server binary exists:
ls -la ../lsp-asun/zig-out/bin/lsp-asun
-
If it does not exist, build it again:
cd ../lsp-asun zig build -
Open the VS Code Output panel and select
ASUN Language Server -
Set
asun.lspPathmanually if auto-detection does not find the binary
The extension could not find lsp-asun or the fallback asun-lsp.
Fixes:
- build
lsp-asunwithzig build - set
asun.lspPathmanually - place the server binary somewhere in your
PATH
Another formatter may be configured as the default formatter for ASUN files.
Add this to your VS Code settings:
{
"[asun]": {
"editor.defaultFormatter": "asun.asun-vscode"
}
}Make sure inlay hints are enabled globally in VS Code:
{
"editor.inlayHints.enabled": "on"
}code --uninstall-extension asun.asun-vscodeYou can also remove it from the Extensions view in VS Code.
| Feature | Action |
|---|---|
| Format | Shift+Option+F or ASUN: Format |
| Compress | ASUN: Compress |
| ASUN to JSON | ASUN: Convert to JSON |
| JSON to ASUN | ASUN: Convert JSON to ASUN |
| Completion | Ctrl+Space |
| Command Palette | Cmd+Shift+P on macOS or Ctrl+Shift+P on Windows/Linux |