From 6a1fe6776716c693c5e0864b8273362d74109188 Mon Sep 17 00:00:00 2001 From: Vishal Raut <155873551+VishalRaut2106@users.noreply.github.com> Date: Wed, 24 Dec 2025 21:42:33 +0530 Subject: [PATCH 1/3] feat: v0.0.1 - Initial project setup with bare minimum structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - TypeScript setup with strict type checking - ESLint + formatting configured - Build pipeline (pnpm build, pnpm dev) - Basic extension scaffolding with hello command - Ready for collaborative development Follows roadmap: - v0.0.x - Initial project setup ✅ - v0.1.x - Basic syntax highlighting (planned) - v0.2.x - Format validation (planned) - v0.3.x - Code formatting and auto-completion (planned) - v1.0.0 - First stable release (planned) --- CHANGELOG.md | 17 ++++++++++++++++ README.md | 50 ++++++++++++++---------------------------------- docs/README.md | 24 +++++++++++++++-------- package.json | 9 ++++++--- src/extension.ts | 10 +++++----- 5 files changed, 58 insertions(+), 52 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..bfd1ca8 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +## [0.0.1] - 2025-12-24 + +### Added +- Initial project setup with TypeScript and build pipeline +- Basic extension scaffolding +- Development tooling (ESLint, tsdown, pnpm) +- Foundation for TOON language support + +### Note +This is the bare minimum structure as outlined in the roadmap: +- v0.0.x - Initial project setup ✅ +- v0.1.x - Basic syntax highlighting (planned) +- v0.2.x - Format validation (planned) +- v0.3.x - Code formatting and auto-completion (planned) +- v1.0.0 - First stable release (planned) \ No newline at end of file diff --git a/README.md b/README.md index 1a3c884..07d4975 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,30 @@ -# TOON Format for Visual Studio Code +# TOON for VS Code -> **⚠️ Development Status:** This extension is in early development. Bare minimum setup for team collaboration. +VS Code extension for TOON (Token-Oriented Object Notation) format. -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. +## Status -## Features +**v0.0.1** - Initial project setup with bare minimum structure. -Currently in development. Planned features: +## Roadmap -- Syntax highlighting for `.toon` files -- Format validation and error detection -- Code formatting and auto-completion -- Integration with TOON specification - -## Installation - -This extension is not yet published to the Visual Studio Marketplace. To install locally: - -```bash -git clone https://github.com/toon-format/vscode.git -cd toon-vscode -pnpm install -pnpm build -``` +- **v0.0.x** - Initial project setup ✅ +- **v0.1.x** - Basic syntax highlighting (planned) +- **v0.2.x** - Format validation (planned) +- **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 diff --git a/docs/README.md b/docs/README.md index d3f93ab..3ffc5fa 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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 +``` diff --git a/package.json b/package.json index 1fc2c75..0135af5 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,10 @@ "keywords": [ "toon", "format", - "serialization" + "serialization", + "llm", + "token-efficient", + "json-alternative" ], "categories": [ "Programming Languages", @@ -32,8 +35,8 @@ "contributes": { "commands": [ { - "command": "toon.helloWorld", - "title": "TOON: Hello World" + "command": "toon.hello", + "title": "TOON: Hello" } ] }, diff --git a/src/extension.ts b/src/extension.ts index 7c976c7..c3b7e88 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,14 +1,14 @@ 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 { // Cleanup if needed -} +} \ No newline at end of file From 243c016391c11df0299656319f87f6fc19338313 Mon Sep 17 00:00:00 2001 From: Vishal Raut <155873551+VishalRaut2106@users.noreply.github.com> Date: Wed, 24 Dec 2025 21:57:29 +0530 Subject: [PATCH 2/3] feat(syntax): Add basic syntax highlighting and language support - Add TextMate grammar for TOON syntax highlighting with support for comments, strings, numbers, booleans, null values, keys, and arrays - Add language configuration with line comments, bracket matching, auto-closing pairs, and indentation rules - Register `.toon` file extension with VS Code language system - Add basic example file demonstrating TOON syntax features - Update package.json to version 0.1.0 and include language and grammar contributions - Update README.md with features section, example code, and roadmap progress - Update CHANGELOG.md with v0.1.0 release notes --- CHANGELOG.md | 27 ++++--- README.md | 27 ++++++- examples/basic.toon | 12 +++ language-configuration.json | 25 ++++++ package.json | 17 +++- syntaxes/toon.tmLanguage.json | 144 ++++++++++++++++++++++++++++++++++ 6 files changed, 238 insertions(+), 14 deletions(-) create mode 100644 examples/basic.toon create mode 100644 language-configuration.json create mode 100644 syntaxes/toon.tmLanguage.json diff --git a/CHANGELOG.md b/CHANGELOG.md index bfd1ca8..3642d18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +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) -- Foundation for TOON language support - -### Note -This is the bare minimum structure as outlined in the roadmap: -- v0.0.x - Initial project setup ✅ -- v0.1.x - Basic syntax highlighting (planned) -- v0.2.x - Format validation (planned) -- v0.3.x - Code formatting and auto-completion (planned) -- v1.0.0 - First stable release (planned) \ No newline at end of file +- Development tooling (ESLint, tsdown, pnpm) \ No newline at end of file diff --git a/README.md b/README.md index 07d4975..23f6286 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,36 @@ VS Code extension for TOON (Token-Oriented Object Notation) format. +## Features + +- **Syntax highlighting** for `.toon` files +- **File recognition** with `.toon` extension +- **Language support** with proper indentation and brackets + +## Example + +```toon +# TOON syntax +name: John Doe +age: 30 +active: true + +address: + street: 123 Main St + city: New York + +hobbies: [reading, coding, hiking] +``` + ## Status -**v0.0.1** - Initial project setup with bare minimum structure. +**v0.1.0** - Basic syntax highlighting and file recognition ✅ ## Roadmap - **v0.0.x** - Initial project setup ✅ -- **v0.1.x** - Basic syntax highlighting (planned) -- **v0.2.x** - Format validation (planned) +- **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) diff --git a/examples/basic.toon b/examples/basic.toon new file mode 100644 index 0000000..9b17d86 --- /dev/null +++ b/examples/basic.toon @@ -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] \ No newline at end of file diff --git a/language-configuration.json b/language-configuration.json new file mode 100644 index 0000000..ad9a34b --- /dev/null +++ b/language-configuration.json @@ -0,0 +1,25 @@ +{ + "comments": { + "lineComment": "#" + }, + "brackets": [ + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + "surroundingPairs": [ + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + "indentationRules": { + "increaseIndentPattern": "^\\s*.*:\\s*$", + "decreaseIndentPattern": "^\\s*$" + } +} \ No newline at end of file diff --git a/package.json b/package.json index 0135af5..2cc5e6f 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "toon", "displayName": "Token-Oriented Object Notation (TOON) Support", "type": "module", - "version": "0.0.1", + "version": "0.1.0", "packageManager": "pnpm@10.23.0", "description": "Visual Studio Code extension for TOON format support", "license": "MIT", @@ -33,6 +33,21 @@ "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.hello", diff --git a/syntaxes/toon.tmLanguage.json b/syntaxes/toon.tmLanguage.json new file mode 100644 index 0000000..e38e504 --- /dev/null +++ b/syntaxes/toon.tmLanguage.json @@ -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" + } + ] + } + ] + } + } +} \ No newline at end of file From 2e1247c21ab0567fdcd3ac4c88f10976c369d597 Mon Sep 17 00:00:00 2001 From: Vishal Raut <155873551+VishalRaut2106@users.noreply.github.com> Date: Wed, 24 Dec 2025 22:01:34 +0530 Subject: [PATCH 3/3] feat: v0.1.0 - Basic syntax highlighting and file recognition --- language-configuration.json | 2 +- src/extension.ts | 2 +- syntaxes/toon.tmLanguage.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/language-configuration.json b/language-configuration.json index ad9a34b..c776644 100644 --- a/language-configuration.json +++ b/language-configuration.json @@ -22,4 +22,4 @@ "increaseIndentPattern": "^\\s*.*:\\s*$", "decreaseIndentPattern": "^\\s*$" } -} \ No newline at end of file +} diff --git a/src/extension.ts b/src/extension.ts index c3b7e88..b85e05c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -11,4 +11,4 @@ export function activate(context: vscode.ExtensionContext): void { export function deactivate(): void { // Cleanup if needed -} \ No newline at end of file +} diff --git a/syntaxes/toon.tmLanguage.json b/syntaxes/toon.tmLanguage.json index e38e504..7916629 100644 --- a/syntaxes/toon.tmLanguage.json +++ b/syntaxes/toon.tmLanguage.json @@ -141,4 +141,4 @@ ] } } -} \ No newline at end of file +}