Skip to content
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

Syntax highlight tagged SQL queries #310

Closed
ForbesLindesay opened this issue Jan 13, 2017 · 4 comments
Closed

Syntax highlight tagged SQL queries #310

ForbesLindesay opened this issue Jan 13, 2017 · 4 comments

Comments

@ForbesLindesay
Copy link

I am writing quite a lot of SQL queries inside JavaScript lately. I would ideally like to be able to have SQL keywords highlighted inside tagged template literals. e.g.

db.query(
  sql`SELECT * FROM MyTable`,
);

Ideally, I'd also like to add other languages after that. Do you think this is something we could make pluggable? Ideally it would be possible to write a separate package that just defines how tagged template literals are highlighted when they have a given tag.

@ForbesLindesay
Copy link
Author

Just found out there are docs for how to do this, reading them now.

@gajus
Copy link

gajus commented Jun 5, 2017

The relevant documentation is here, https://github.com/gandm/language-babel#javascript-tagged-template-literal-grammar-extensions.

@christiaanwesterbeek
Copy link

For months I had highlighting of sql code inside template literals in my js file working without language-babel installed, but with language-sql installed in Atom. Exactly like this:

const sql = String.raw;
db.query(
  sql`SELECT * FROM MyTable`,
);

Today I updated Atom to 1.32.0 and now, no more sql hightlighting inside template literals.

Still trying to find out why. Installing language-babel and adding "(?:css\.(?:[a-z])+)":source.css, /* @html */:text.html.basic, sql:source.sql this inside the settings of language-babel did not help. Restarting Atom did not help.

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

No branches or pull requests

4 participants