Repository navigation
Basic syntax highlighting and file recognition #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6a1fe67
243c016
2e1247c
a99b392
c74fbba
f7a8028
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
|
|
||
| ### Grammar (spec-compliant) | ||
| - Array header syntax: `key[N]: v1,v2` and `key[N]{f1,f2}:` tabular headers | ||
| - Dotted key support: `user.name: value` | ||
| - List item markers: `- value` | ||
| - Strings (quoted), numbers, booleans, null values | ||
| - No comment syntax (TOON has none per spec) | ||
|
|
||
|
VishalRaut2106 marked this conversation as resolved.
Comment on lines
+15
to
+18
|
||
| ## [0.0.1] - 2025-12-24 | ||
|
|
||
| ### Added | ||
| - Initial project setup with TypeScript and build pipeline | ||
| - Basic extension scaffolding | ||
| - Development tooling (ESLint, tsdown, pnpm) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,21 @@ | ||
| # 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, tabular arrays like CSV | ||
| - **Arrays**: `key[N]: v1,v2,v3` or tabular `key[N]{f1,f2}:` | ||
| - **Dotted keys**: `user.name: value` | ||
|
|
||
| ## Example | ||
|
|
||
| ```toon | ||
| name: Example | ||
| user.role: admin | ||
| items[3]: a,b,c | ||
| rows[2]{id,name}: | ||
| 1,Alice | ||
| 2,Bob | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| name: John Doe | ||
| age: 30 | ||
| active: true | ||
|
|
||
| address: | ||
| street: 123 Main St | ||
| city: New York | ||
|
|
||
| hobbies[3]: reading,coding,hiking | ||
|
|
||
| projects[2]{id,name,status}: | ||
| 1,Alpha,active | ||
| 2,Beta,completed | ||
|
|
||
| user.role: admin |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "brackets": [ | ||
| ["[", "]"], | ||
| ["{", "}"] | ||
| ], | ||
| "autoClosingPairs": [ | ||
| { "open": "[", "close": "]" }, | ||
| { "open": "{", "close": "}" }, | ||
| { "open": "\"", "close": "\"" } | ||
| ], | ||
| "surroundingPairs": [ | ||
| ["[", "]"], | ||
| ["{", "}"], | ||
| ["\"", "\""] | ||
| ], | ||
| "indentationRules": { | ||
| "increaseIndentPattern": "^\\s*(?:(?:[A-Za-z_][A-Za-z0-9_.]*|\"[^\"]*\")(?:\\[\\d+[|\\t]?\\](?:\\{[^}]*\\})?)?|\\[\\d+[|\\t]?\\](?:\\{[^}]*\\})?):\\s*$" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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", | ||
|
|
@@ -18,7 +18,10 @@ | |
| "keywords": [ | ||
| "toon", | ||
| "format", | ||
| "serialization" | ||
| "serialization", | ||
| "llm", | ||
| "token-efficient", | ||
| "json-alternative" | ||
| ], | ||
| "categories": [ | ||
| "Programming Languages", | ||
|
|
@@ -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" | ||
| } | ||
| ] | ||
| }, | ||
|
VishalRaut2106 marked this conversation as resolved.
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", | ||
| "name": "TOON", | ||
| "scopeName": "source.toon", | ||
| "patterns": [ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No rule for comment lines yet. Only spaces may precede the |
||
| { "include": "#tabular-header" }, | ||
| { "include": "#array-header" }, | ||
| { "include": "#list-item" }, | ||
| { "include": "#key-value" } | ||
| ], | ||
| "repository": { | ||
| "tabular-header": { | ||
| "comment": "§6: key[N]{f1,f2}: or key[N|]{f1|f2}: or key[N\t]{f1\tf2}:", | ||
| "match": "^(\\s*)([A-Za-z_][A-Za-z0-9_.]*|\"[^\"]*\")(\\[\\d+[|\\t]?\\])(\\{[^}]*\\})(:)(.*)", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "captures": { | ||
| "2": { "name": "entity.name.tag.toon" }, | ||
| "3": { "name": "constant.numeric.toon" }, | ||
| "4": { "name": "entity.other.attribute-name.toon" }, | ||
| "5": { "name": "punctuation.separator.key-value.toon" }, | ||
| "6": { "patterns": [{ "include": "#values" }] } | ||
| } | ||
| }, | ||
| "array-header": { | ||
| "comment": "§6: key[N]: or key[N|]: or key[N\t]: — also root [N]:", | ||
| "match": "^(\\s*)([A-Za-z_][A-Za-z0-9_.]*|\"[^\"]*\")?(\\[\\d+[|\\t]?\\])(:)(.*)", | ||
| "captures": { | ||
| "2": { "name": "entity.name.tag.toon" }, | ||
| "3": { "name": "constant.numeric.toon" }, | ||
| "4": { "name": "punctuation.separator.key-value.toon" }, | ||
| "5": { "patterns": [{ "include": "#values" }] } | ||
| } | ||
| }, | ||
| "list-item": { | ||
| "comment": "§9.4, §10: list item starting with '- '", | ||
| "match": "^(\\s*)(-)( )(.*)", | ||
| "captures": { | ||
| "2": { "name": "punctuation.definition.list.begin.toon" }, | ||
| "4": { "patterns": [{ "include": "#tabular-header" }, { "include": "#array-header" }, { "include": "#key-value" }, { "include": "#values" }] } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| } | ||
| }, | ||
| "key-value": { | ||
| "comment": "§7.3, §8: simple or dotted key followed by colon", | ||
| "match": "^(\\s*)([A-Za-z_][A-Za-z0-9_.]*|\"[^\"]*\")(:)(.*)", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "captures": { | ||
| "2": { "name": "entity.name.tag.toon" }, | ||
| "3": { "name": "punctuation.separator.key-value.toon" }, | ||
| "4": { "patterns": [{ "include": "#values" }] } | ||
| } | ||
| }, | ||
| "values": { | ||
| "patterns": [ | ||
| { "include": "#string-quoted" }, | ||
| { "include": "#number" }, | ||
| { "include": "#boolean" }, | ||
| { "include": "#null" } | ||
| ] | ||
|
VishalRaut2106 marked this conversation as resolved.
Comment on lines
+50
to
+56
|
||
| }, | ||
| "string-quoted": { | ||
| "name": "string.quoted.double.toon", | ||
| "begin": "\"", | ||
| "end": "\"", | ||
| "patterns": [ | ||
| { "name": "constant.character.escape.toon", "match": "\\\\[\\\\\"nrt]" }, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| { "name": "invalid.illegal.escape.toon", "match": "\\\\." } | ||
| ] | ||
| }, | ||
| "number": { | ||
| "name": "constant.numeric.toon", | ||
| "match": "(?<![A-Za-z0-9_.])-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?(?![A-Za-z0-9_.])" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }, | ||
| "boolean": { | ||
| "patterns": [ | ||
| { "name": "constant.language.boolean.true.toon", "match": "\\btrue\\b" }, | ||
| { "name": "constant.language.boolean.false.toon", "match": "\\bfalse\\b" } | ||
| ] | ||
| }, | ||
| "null": { | ||
| "name": "constant.language.null.toon", | ||
| "match": "\\bnull\\b" | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer true since spec 4.0.