Skip to content

Make it possible to also use SQL "magic comments" to signify SQL template literals #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vais
Copy link

@vais vais commented Jun 3, 2025

Thank you for sharing this plugin!

I've been using it (together with https://github.com/un-ts/prettier/tree/master/packages/sql and https://github.com/Sec-ant/prettier-plugin-embed) on a codebase that uses "magic comments" to signal that the string literal that follows is SQL. E.g:

const query = /* sql */ `
  select
    *
  from ...
`;

So, I had to adapt your plugin to recognize this pattern of using block comments in addition to using tags. Both continue to work with my modifications in case-insensitive manner - e.g. sql, SQL, Sql, etc all work for both block comments and tags.

I also removed hi def link sqlTemplateString jsTemplateString - SQL syntax highlighting looks better without it (I understand this is subjective, but maybe give it a try).

Once again, thank you for making this plugin - it made my SQL more colorful, and my day a little brighter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant