-
Notifications
You must be signed in to change notification settings - Fork 5
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
Open
VishalRaut2106
wants to merge
6
commits into
toon-format:main
Choose a base branch
from
VishalRaut2106:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6a1fe67
feat: v0.0.1 - Initial project setup with bare minimum structure
VishalRaut2106 243c016
feat(syntax): Add basic syntax highlighting and language support
VishalRaut2106 2e1247c
feat: v0.1.0 - Basic syntax highlighting and file recognition
VishalRaut2106 a99b392
fix: spec-compliant grammar per maintainer review
VishalRaut2106 c74fbba
Potential fix for pull request finding
VishalRaut2106 f7a8028
Potential fix for pull request finding
VishalRaut2106 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | ||
|
|
||
|
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) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "brackets": [ | ||
| ["[", "]"], | ||
| ["{", "}"] | ||
| ], | ||
| "autoClosingPairs": [ | ||
| { "open": "[", "close": "]" }, | ||
| { "open": "{", "close": "}" }, | ||
| { "open": "\"", "close": "\"" } | ||
| ], | ||
| "surroundingPairs": [ | ||
| ["[", "]"], | ||
| ["{", "}"], | ||
| ["\"", "\""] | ||
| ], | ||
| "indentationRules": { | ||
| "increaseIndentPattern": "^\\s*(?:(?:[A-Za-z_][A-Za-z0-9_.]*|\"[^\"]*\")(?:\\[\\d+[|\\t]?\\](?:\\{[^}]*\\})?)?|\\[\\d+[|\\t]?\\](?:\\{[^}]*\\})?):\\s*$" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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": [ | ||
| { "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]?\\])(\\{[^}]*\\})(:)(.*)", | ||
| "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" }] } | ||
| } | ||
| }, | ||
| "key-value": { | ||
| "comment": "§7.3, §8: simple or dotted key followed by colon", | ||
| "match": "^(\\s*)([A-Za-z_][A-Za-z0-9_.]*|\"[^\"]*\")(:)(.*)", | ||
| "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]" }, | ||
| { "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_.])" | ||
| }, | ||
| "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" | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.