Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog

## [0.1.0] - 2025-12-24

### Added
- Syntax highlighting for `.toon` files
- File recognition with `.toon` extension
- Language configuration with proper indentation and brackets
- TextMate grammar for TOON syntax
- Basic example file

### Features
- Comments with `#`
- Strings (quoted and unquoted)
- Numbers, booleans, null values
- Object keys and nested structures
- Array syntax with brackets

## [0.0.1] - 2025-12-24

### Added
- Initial project setup with TypeScript and build pipeline
- Basic extension scaffolding
- Development tooling (ESLint, tsdown, pnpm)
63 changes: 31 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,51 @@
# TOON Format for Visual Studio Code
# TOON for VS Code

> **⚠️ Development Status:** This extension is in early development. Bare minimum setup for team collaboration.

Visual Studio Code extension for TOON format support. TOON is a compact, human-readable serialization format for LLM contexts with 30-60% token reduction vs JSON.
VS Code extension for TOON (Token-Oriented Object Notation) format.

## Features

Currently in development. Planned features:
- **Syntax highlighting** for `.toon` files
- **File recognition** with `.toon` extension
- **Language support** with proper indentation and brackets

- Syntax highlighting for `.toon` files
- Format validation and error detection
- Code formatting and auto-completion
- Integration with TOON specification
## Example

## Installation
```toon
# TOON syntax
name: John Doe
age: 30
active: true

This extension is not yet published to the Visual Studio Marketplace. To install locally:
address:
street: 123 Main St
city: New York

```bash
git clone https://github.com/toon-format/vscode.git
cd toon-vscode
pnpm install
pnpm build
hobbies: [reading, coding, hiking]
```

## Status

**v0.1.0** - Basic syntax highlighting and file recognition βœ…

## Roadmap

- **v0.0.x** - Initial project setup βœ…
- **v0.1.x** - Basic syntax highlighting βœ…
- **v0.2.x** - Format validation (next)
- **v0.3.x** - Code formatting and auto-completion (planned)
- **v1.0.0** - First stable release (planned)

## Development

```bash
# Setup
git clone https://github.com/toon-format/vscode.git
cd toon-vscode
pnpm install

# Build
pnpm build
```

# Development mode (watch)
pnpm dev

# Run linting
pnpm lint

# Type check
pnpm test:types
## Links

# Package extension
pnpm package
```
- [TOON Specification](https://github.com/toon-format/spec)
- [Report Issues](https://github.com/toon-format/vscode/issues)

## Project Status & Roadmap

Expand Down
24 changes: 16 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# TOON VSCode Extension Documentation
# TOON Extension Docs

This directory will contain comprehensive documentation for the TOON VSCode extension.
Basic documentation for the TOON VS Code extension.

## Coming Soon
## Quick Reference

- Installation guide
- Feature documentation
- Configuration options
- Development guide
- API reference
- **File extension**: `.toon`
- **Format**: Indentation-based like YAML
- **Comments**: Start with `#`
- **Arrays**: Use `[item1, item2]` or multi-line format

## Example

```toon
name: Example
items: [a, b, c]
nested:
key: value
```
12 changes: 12 additions & 0 deletions examples/basic.toon
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Basic TOON example
name: John Doe
age: 30
active: true

# Nested object
address:
street: 123 Main St
city: New York

# Array
hobbies: [reading, coding, hiking]
25 changes: 25 additions & 0 deletions language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"comments": {
"lineComment": "#"
},
"brackets": [
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
],
"surroundingPairs": [
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
],
"indentationRules": {
"increaseIndentPattern": "^\\s*.*:\\s*$",
"decreaseIndentPattern": "^\\s*$"
}
}
26 changes: 22 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "toon",
"displayName": "Token-Oriented Object Notation (TOON) Support",
"type": "module",
"version": "0.0.1",
"version": "0.1.0",
"packageManager": "[email protected]",
"description": "Visual Studio Code extension for TOON format support",
"license": "MIT",
Expand All @@ -18,7 +18,10 @@
"keywords": [
"toon",
"format",
"serialization"
"serialization",
"llm",
"token-efficient",
"json-alternative"
],
"categories": [
"Programming Languages",
Expand All @@ -30,10 +33,25 @@
"node": ">=24.0.0"
},
"contributes": {
"languages": [
{
"id": "toon",
"aliases": ["TOON", "toon"],
"extensions": [".toon"],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "toon",
"scopeName": "source.toon",
"path": "./syntaxes/toon.tmLanguage.json"
}
],
"commands": [
{
"command": "toon.helloWorld",
"title": "TOON: Hello World"
"command": "toon.hello",
"title": "TOON: Hello"
}
]
},
Expand Down
8 changes: 4 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as vscode from 'vscode'

export function activate(context: vscode.ExtensionContext): void {
// Register the hello world command
const disposable = vscode.commands.registerCommand('toon.helloWorld', () => {
vscode.window.showInformationMessage('Hello World from TOON!')
// Basic hello command for initial setup
const helloCommand = vscode.commands.registerCommand('toon.hello', () => {
vscode.window.showInformationMessage('TOON extension activated! Ready for development.')
})

context.subscriptions.push(disposable)
context.subscriptions.push(helloCommand)
}

export function deactivate(): void {
Expand Down
144 changes: 144 additions & 0 deletions syntaxes/toon.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "TOON",
"scopeName": "source.toon",
"patterns": [
{
"include": "#comments"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#booleans"
},
{
"include": "#null"
},
{
"include": "#keys"
},
{
"include": "#arrays"
}
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.line.number-sign.toon",
"match": "#.*$"
}
]
},
"strings": {
"patterns": [
{
"name": "string.quoted.double.toon",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.toon",
"match": "\\\\."
}
]
},
{
"name": "string.quoted.single.toon",
"begin": "'",
"end": "'",
"patterns": [
{
"name": "constant.character.escape.toon",
"match": "\\\\."
}
]
},
{
"name": "string.unquoted.toon",
"match": "(?<=:\\s)[^\\s#\\[\\]()][^#\\n]*"
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.toon",
"match": "\\b-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b"
}
]
},
"booleans": {
"patterns": [
{
"name": "constant.language.boolean.true.toon",
"match": "\\btrue\\b"
},
{
"name": "constant.language.boolean.false.toon",
"match": "\\bfalse\\b"
}
]
},
"null": {
"patterns": [
{
"name": "constant.language.null.toon",
"match": "\\bnull\\b"
}
]
},
"keys": {
"patterns": [
{
"name": "entity.name.tag.toon",
"match": "^\\s*([a-zA-Z_][a-zA-Z0-9_]*)\\s*:",
"captures": {
"1": {
"name": "entity.name.tag.toon"
}
}
},
{
"name": "entity.name.tag.quoted.toon",
"match": "^\\s*(\"[^\"]*\"|'[^']*')\\s*:",
"captures": {
"1": {
"name": "string.quoted.toon"
}
}
}
]
},
"arrays": {
"patterns": [
{
"name": "meta.structure.array.toon",
"begin": "\\[",
"end": "\\]",
"patterns": [
{
"include": "#comments"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#booleans"
},
{
"include": "#null"
}
]
}
]
}
}
}