ASUN Support brings first-class editing support for ASUN files to Visual Studio Code.
ASUN is designed for structured data that should stay compact, readable, and strongly shaped at the same time. Instead of treating data as loose JSON blobs, ASUN keeps schema and values close together, which makes large config files, fixtures, datasets, and generated data easier to scan and safer to edit.
ASUN is useful when you want more structure than plain JSON, without giving up readability.
- Schema and data stay together, so the shape of the content is visible where you read it.
- Tuple-style records reduce repetition in repeated datasets.
- Stronger typing makes mistakes easier to catch early.
- The format stays compact for storage, but can still be expanded into a readable layout.
Example:
[{name@str, age@int, active@bool}]:
(Alice, 30, true),
(Bob, 24, false)
Compared with repeated object keys in JSON, this format is often shorter and easier to inspect in bulk data.
ASUN has practical serialization advantages because of how the format is designed, not just because of editor tooling.
- The schema is written once, instead of repeating keys in every object.
- Repeated records are stored as tuples, which reduces structural noise.
- Optional type annotations make data contracts visible and easier to validate.
- The same schema can be used for both human-readable text and more compact binary-oriented workflows in the broader ASUN ecosystem.
For array-shaped or repeated structured data, that usually means less text to move, parse, and send to models.
Based on benchmarks and examples in the ASUN implementations in this repository, the main gains versus JSON are:
- Token usage: typically 30% to 70% fewer tokens
- Payload size: typically 40% to 60% smaller
- Text serialization: commonly about 1.4x to 2.4x faster
- Text deserialization: commonly about 1.9x to 4.4x faster
The main reason is simple: JSON repeats field names for every row, while ASUN writes the schema once and then only emits values.
Concrete example used across the project:
JSON: 100 tokens
ASUN: ~35 tokens
Saving: ~65%
For many structured datasets, that also means noticeably less network bandwidth and lower LLM prompt cost.
This extension focuses on daily editing workflows, not just file recognition.
- Syntax highlighting for
.asunfiles - Markdown fenced code block highlighting for
asun - Real-time diagnostics from the ASUN language server
- Document formatting for readable multiline layout
- Compression/minification for compact output
- Convert ASUN to JSON
- Convert JSON to ASUN
- Inlay hints for tuple field names
- Semantic tokens for richer editor coloring
- Context menu and command palette integration
Turn dense ASUN into a clean, aligned structure.
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))
Convert formatted content back into a compact single-line representation.
{name@str,age@int}:(Alice,30)
Use ASUN where schema-aware editing is helpful, then export JSON when another system expects it.
ASUN:
{name@str, age@int, active@bool}:
(Alice, 30, true)
JSON:
{
"active": true,
"age": 30,
"name": "Alice"
}For tuple-style records, the extension can display field-name hints inline so values are easier to interpret while editing.
Source:
{name@str, age@int, city@str}:(Alice, 30, NYC)
Displayed in the editor:
{name@str, age@int, city@str}:(name: Alice, age: 30, city: NYC)
The extension adds these commands:
ASUN: Format (Beautify)ASUN: Compress (Minify)ASUN: Convert to JSONASUN: Convert JSON to ASUN
They are available from the Command Palette, and the relevant actions also appear in the editor context menu.
Available settings:
asun.lspPath: absolute path to thelsp-asunbinary if you want to override auto-detectionasun.inlayHints.enabled: enable or disable tuple field-name hints
If the bundled or default server path is not detected automatically, set:
{
"asun.lspPath": "/absolute/path/to/lsp-asun"
}- Install the extension.
- Open or create a
.asunfile. - Run
ASUN: Format (Beautify)orASUN: Convert to JSONfrom the Command Palette.
If syntax highlighting works but diagnostics or formatting do not, the ASUN language server is usually missing or not found. In that case, set asun.lspPath manually.
Marketplace-facing documentation is intentionally kept separate from build instructions.
