Syntax Highlighting for SQL in Tagged Template Literals
In @databases
you will use a lot of SQL strings inline within your TypeScript or JavaScript code. These strings are always "tagged" with the sql
prefix, meaning we can use plugins to ensure they are highlighted as SQL, rather than just a string.
VS Code Syntax Highlighting Extension
The vscode-sql-template-literal
extension provides syntax highlighting for VS Code:
Atom Syntax Highlighting Plugin
This doesn't seem to be working at the moment, see gandm/language-babel#525
To enable highlighting, you need to:
Install the
language-babel
package.Configure
language-babel
"JavaScript Tagged Template Literal Grammar Extensions" setting to usesource.sql
to highlight template literals withsql
tag (configuration value:sql:source.sql
).
For more information, refer to the JavaScript Tagged Template Literal Grammar Extensions documentation of language-babel
package.