From b2174a00e8d1b8841be2cfdcdce8ce562e438368 Mon Sep 17 00:00:00 2001 From: Brighten Tompkins Date: Thu, 2 Dec 2021 19:39:35 -0800 Subject: [PATCH 1/6] feat(added-support-for-use-with-coconut): coconut is awesome --- package.json | 10 ++++++---- syntaxes/highlight-html-string.json | 7 +++++-- syntaxes/highlight-sql-string.json | 7 +++++-- 3 files changed, 16 insertions(+), 8 deletions(-) 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..a88f333 100644 --- a/syntaxes/highlight-sql-string.json +++ b/syntaxes/highlight-sql-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)", "patterns": [ @@ -20,4 +23,4 @@ } ], "scopeName": "python-sql.injection" -} \ No newline at end of file +} From 9ec03c7aacb93226169786544a3cb6edbf65a9ed Mon Sep 17 00:00:00 2001 From: AndrewBasem1 <102801029+AndrewBasem1@users.noreply.github.com> Date: Mon, 26 Sep 2022 20:29:39 +0200 Subject: [PATCH 2/6] Adding support for mySQL mySQL queries will fail with the '--sql' tag on top, because mySQL comments requires at least one space between the double dash and text after '-- sql', so added this as well. --- syntaxes/highlight-sql-string.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/highlight-sql-string.json b/syntaxes/highlight-sql-string.json index 50ad41e..2c4c923 100644 --- a/syntaxes/highlight-sql-string.json +++ b/syntaxes/highlight-sql-string.json @@ -5,8 +5,8 @@ "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 +20,4 @@ } ], "scopeName": "python-sql.injection" -} \ No newline at end of file +} From cf8c23f382b34e493653ea4a5625df3cb69c1c6f Mon Sep 17 00:00:00 2001 From: Peter Weir Date: Mon, 6 Nov 2023 15:09:40 -0800 Subject: [PATCH 3/6] Update README.md allow spaces after -- --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 293c432..5a44b2e 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: From b9702385812e857d34239b15d7bf7d832486ac94 Mon Sep 17 00:00:00 2001 From: Peter Weir Date: Mon, 6 Nov 2023 15:10:29 -0800 Subject: [PATCH 4/6] Update package-lock.json bump version number --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } From cd716c3ec4e0618a22c7345936b92a3fce10f6f5 Mon Sep 17 00:00:00 2001 From: Peter Weir Date: Mon, 6 Nov 2023 15:12:07 -0800 Subject: [PATCH 5/6] Update README.md added release note for 1.2.0 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 5a44b2e..0cc04c1 100644 --- a/README.md +++ b/README.md @@ -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 From f3b5377faacb4a86238772a76db252dbedd80490 Mon Sep 17 00:00:00 2001 From: Peter Weir Date: Mon, 6 Nov 2023 15:13:01 -0800 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) 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