diff --git a/.gitignore b/.gitignore index 275236c..2d95cd9 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,6 @@ dist .vscode/**/* !.vscode/launch.json .DS_Store + +# Test files +test-frontmatter.sudo.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 7978bb8..493c692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Added +- YAML frontmatter syntax highlighting for .sudo.md files - Keys, values, and quoted strings now have proper syntax highlighting matching standard .md files. - New [Autodux](examples/autodux.sudo) demonstrates how to use SudoLang to create a Redux state management system that automatically generates reducers, action creators, and selectors based on a brief description. - New [Whispers](examples/whispers.sudo) text adventure game demonstrates rich constraint-based programming and game `/save` and `/load` commands. diff --git a/package-lock.json b/package-lock.json index 36afb72..29e9bf2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sudolang-llm-support", - "version": "2.0.0-rc.1", + "version": "2.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sudolang-llm-support", - "version": "2.0.0-rc.1", + "version": "2.0.0", "hasInstallScript": true, "devDependencies": { "@types/node": "14.x", diff --git a/sudolang-llm-support-2.0.0.vsix b/sudolang-llm-support-2.0.0.vsix index cbb2caf..5c8bca1 100644 Binary files a/sudolang-llm-support-2.0.0.vsix and b/sudolang-llm-support-2.0.0.vsix differ diff --git a/syntaxes/sudolang.tmLanguage.json b/syntaxes/sudolang.tmLanguage.json index 02796f9..61d703d 100644 --- a/syntaxes/sudolang.tmLanguage.json +++ b/syntaxes/sudolang.tmLanguage.json @@ -3,6 +3,7 @@ "name": "SudoLang", "fileTypes": ["sudo", "sudo.md", "mdc"], "patterns": [ + { "include": "#frontmatter" }, { "include": "#comments" }, { "include": "#markdown-headers" }, { "include": "#keywords" }, @@ -15,6 +16,21 @@ { "include": "#expressions" } ], "repository": { + "frontmatter": { + "begin": "\\A(---)", + "beginCaptures": { + "1": { "name": "punctuation.definition.comment.yaml" } + }, + "end": "^(---|\\.\\.\\.)", + "endCaptures": { + "1": { "name": "punctuation.definition.comment.yaml" } + }, + "name": "meta.embedded.block.frontmatter", + "contentName": "source.yaml", + "patterns": [ + { "include": "source.yaml" } + ] + }, "markdown-headers": { "patterns": [ {