TOON Tools adds basic support for working with TOON files in Visual Studio Code.
Features
.toonlanguage support- Basic syntax highlighting
- JSON to TOON conversion command
- TOON to JSON conversion command
- TOON document formatter
- Optional auto-convert on save
Commands
TOON: Convert JSON to TOONTOON: Convert TOON to JSON
Settings
TOON Tools contributes settings under TOON Tools in VS Code Settings.
| Setting | Default | Description |
|---|---|---|
toonTools.autoConvertOnSave |
false |
Create or update a sibling .json or .toon file when saving. |
toonTools.autoConvertDirection |
both |
Choose both, jsonToToon, or toonToJson. |
toonTools.autoConvertOverwriteExisting |
false |
Ask before overwriting an existing sibling file. |
toonTools.autoConvertMaxFileSizeKb |
1024 |
Skip auto-convert for documents larger than this size. |
Example
JSON:
{
"users": [
{
"id": 1,
"name": "Alice",
"role": "admin"
},
{
"id": 2,
"name": "Bob",
"role": "user"
}
]
}
TOON:
users[2]{id,name,role}:
1,Alice,admin
2,Bob,user
Development
These steps are for working on the extension locally, not for using it after installation.
Install dependencies:
npm install
Compile the extension:
npm run compile
Run it in VS Code:
- Open this folder in VS Code.
- Press
F5. - Test commands in the Extension Development Host window.
Package a local .vsix:
npm run vsix