diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e0e112..f497267 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog] (http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +### [1.2.0] - 2023-11-06 +- Added support for mysql by allowing a space after -- + ### [1.1.0] - 2019-06-04 - Added support for f-strings diff --git a/README.md b/README.md index 293c432..0cc04c1 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Install `python-string-sql` from extensions (`ctrl + shift + x` or `cmd + shift ## Usage -Insert `--sql`, `--beginsql`, or `--begin-sql` at the beginning of the part of the string you would like highlighted and a semicolon, `--endsql`, or `--end-sql` at the end of the highlighted section. +Insert `--sql`, `--beginsql`, or `--begin-sql` at the beginning of the part of the string you would like highlighted (with or without a space after --, e.g. `-- sql`) and a semicolon, `--endsql`, or `--end-sql` at the end of the highlighted section. ### Snippets begin typing `sql` and the autocomplete snippet will appear: @@ -41,6 +41,9 @@ SELECT ## Release Notes +### [1.2.0] - 2023-11-06 +- Added support for mysql by allowing a space after -- + ### [1.1.0] - 2019-06-04 - Added support for f-strings diff --git a/package-lock.json b/package-lock.json index 6b0cfca..31acf09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { "name": "python-string-sql", - "version": "1.1.0", + "version": "1.2.0", "lockfileVersion": 1 } diff --git a/package.json b/package.json index 098c6c1..acdcf19 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "python-string-sql", "displayName": "python-string-sql", "description": "highlight python strings as sql", - "version": "1.1.0", + "version": "1.2.0", "publisher": "ptweir", "icon": "docs/logo.png", "repository": { @@ -21,7 +21,8 @@ "path": "./syntaxes/highlight-sql-string.json", "scopeName": "python-sql.injection", "injectTo": [ - "source.python" + "source.python", + "source.coconut" ], "embeddedLanguages": { "meta.embedded.sql": "sql" @@ -31,7 +32,8 @@ "path": "./syntaxes/highlight-html-string.json", "scopeName": "python-html.injection", "injectTo": [ - "source.python" + "source.python", + "source.coconut" ], "embeddedLanguages": { "meta.embedded.block.html": "html" @@ -51,7 +53,7 @@ "mac": "ctrl+s", "when": "editorTextFocus", "args": { - "langId": "python", + "langId": ["python", "coconut"], "name": "SQL_highlighted_string" } } diff --git a/syntaxes/highlight-html-string.json b/syntaxes/highlight-html-string.json index 85af0c1..aecaf03 100644 --- a/syntaxes/highlight-html-string.json +++ b/syntaxes/highlight-html-string.json @@ -1,6 +1,9 @@ { "fileTypes": [ - "py" + "py", + "coc", + "coco", + "coconut" ], "injectionSelector": "L:string.quoted.multi.python, L:meta.fstring.python - (comment.line.number-sign.python, punctuation.definition.comment.python)", "repository": { @@ -54,4 +57,4 @@ } ], "scopeName": "python-html.injection" -} \ No newline at end of file +} diff --git a/syntaxes/highlight-sql-string.json b/syntaxes/highlight-sql-string.json index 50ad41e..0ad1aab 100644 --- a/syntaxes/highlight-sql-string.json +++ b/syntaxes/highlight-sql-string.json @@ -1,12 +1,15 @@ { "fileTypes": [ - "py" + "py", + "coc", + "coco", + "coconut" ], "injectionSelector": "L:string.quoted.multi.python, L:meta.fstring.python - (comment.line.number-sign.python, punctuation.definition.comment.python)", "patterns": [ { - "begin": "( *--sql| *--beginsql| *--begin-sql)", - "end": "( *;| *--endsql| *--end-sql)", + "begin": "( *--sql| *--beginsql| *--begin-sql| *-- sql| *-- beginsql| *-- begin-sql)", + "end": "( *;| *--endsql| *--end-sql| * ;| *-- endsql| *-- end-sql)", "captures": { "1": { "name": "variable.parameter" @@ -20,4 +23,4 @@ } ], "scopeName": "python-sql.injection" -} \ No newline at end of file +}