Enable syntax highlighting for SQL inside Python multiline strings using VS Code.
As the extension is in development, installation is only possible manually.
Install node.js and then then install the vsce package:
npm install --global vsce
Clone the repository and open a terminal at the project root and execute the following command:
vsce package
The resulting .vsix
file can be installed via the VSCode GUI.
Multiline SQL statements require an SQL comment -- SQL
or /* SQL */
as the same line as the opening triple quotes.
Note that this extension does not highlight SQL itself, it merely
uses whatever highlighter is associated with the .sql
extension.
The project was adpated from es6-string-html. Considerable insight into writing the TextMate grammars used by VS Code, can be found in an old blog post by Matt Neuburg.