Full-featured VS Code extension for the TOON format
Features β’ Installation β’ Usage β’ Contributing β’ Examples
Toon Language Support is a comprehensive VS Code extension that provides syntax highlighting, validation, auto-completion, and formatting for the TOON format β a token-oriented data format optimized for LLM processing.
This extension transforms your VS Code into a powerful editor for .toon files, making it easy to work with tabular arrays, inline arrays, mixed arrays, and all TOON format features.
-
π€ Full Syntax Highlighting
- Tabular arrays with field definitions
- Inline arrays with comma/tab/pipe delimiters
- Mixed arrays with list markers
- Root-level arrays
- Strings, numbers, booleans, and null values
- Comments (single-line and block)
-
β‘ Smart Auto-completion
- Snippets for all array types
- Property templates
- Boolean and null value suggestions
-
β Real-time Validation
- Array length mismatch detection
- Visual warnings in the editor
- Configurable validation settings
-
π¨ Code Formatting
- Auto-indentation (2-space standard)
- Consistent formatting rules
- Format on save support
-
π‘ Hover Information
- Detailed array information
- Delimiter type display
- Field definitions for tabular arrays
-
π File Icons
- Custom icon theme for
.toonfiles - Visual file identification
- Custom icon theme for
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X/Cmd+Shift+X) - Search for "Toon Language Support"
- Click Install
# Clone the repository
git clone https://github.com/eveiljuice/vscode-toon.git
cd vscode-toon
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Press F5 to run in Extension Development Host- Create or open a
.toonfile - Start typing β syntax highlighting activates automatically
- Use
Ctrl+Spacefor auto-completion - Use
Shift+Alt+Fto format your document - Hover over arrays to see detailed information
Add to your VS Code settings.json:
{
"toon.validation.enabled": true
}users[3]{id,name,email,plan,active}:
1,Alice Mitchell,[email protected],Premium,true
2,Michael Chen,[email protected],Basic,true
3,Jennifer Kumar,[email protected],Enterprise,false
tags[2]: analytics,notifications
features[3]: search,filter,sort
items[3]:
- 1
- a: 1
- x
[2]: x,y
Tab delimiter:
items[2\t]{sku\tqty\tprice}:
A1\t2\t9.99
B2\t1\t14.5
Pipe delimiter:
data[2|]{name|value}:
Alice|admin
Bob|user
The extension automatically validates array declarations:
users[3]{id,name}: // β οΈ Warning: declared 3 but has 2 items
1,Alice
2,Bob
vscode-toon/
βββ src/
β βββ extension.ts # Main extension logic
βββ syntaxes/
β βββ toon.tmLanguage.json # TextMate grammar for syntax highlighting
βββ icons/
β βββ toon-icon.svg # Custom icon for .toon files
β βββ toon-icon-theme.json # Icon theme configuration
βββ language-configuration.json # Language configuration (comments, brackets, etc.)
βββ package.json # Extension manifest
βββ tsconfig.json # TypeScript configuration
βββ README.md # This file
Im welcome contributions! Here's how you can help:
-
Fork the repository
git clone https://github.com/eveiljuice/vscode-toon.git cd vscode-toon -
Install dependencies
npm install
-
Make your changes
- Edit files in
src/for extension logic - Edit
syntaxes/toon.tmLanguage.jsonfor syntax highlighting - Edit
language-configuration.jsonfor language features
- Edit files in
-
Test your changes
npm run compile # Press F5 in VS Code to launch Extension Development Host -
Submit a Pull Request
- Create a new branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m "Add: your feature description" - Push to your fork:
git push origin feature/your-feature-name - Open a PR on GitHub
- Create a new branch:
- Code Style: Follow TypeScript best practices
- Testing: Test your changes in Extension Development Host before submitting
- Documentation: Update README if adding new features
- Commits: Use clear, descriptive commit messages
- π Bug fixes: Report and fix issues
- β¨ New features: Add support for new TOON format features
- π Documentation: Improve examples and documentation
- π¨ Syntax highlighting: Enhance color schemes and highlighting
- β‘ Performance: Optimize validation and formatting
Found a bug? Have a feature request? Open an issue!
Please include:
- VS Code version
- Extension version
- Steps to reproduce
- Expected vs actual behavior
- Sample
.toonfile (if applicable)
This project is licensed under the MIT License - see the LICENSE file for details.
- Built for the TOON format community
- Inspired by modern token-oriented data formats
Made with β€οΈ for the TOON community
β Star this repo β’ π Report Bug β’ π‘ Request Feature