2

enter image description here

The first syntax highlighting is of VS Code and the second one is of Sublime Text. I searched for extensions but I couldn't find anything which could detect SQL commands like CREATE TABLE and highlight them or suggest them as I start typing.

Sublime Text and Atom have this feature by default, but I can't get it to work in VS Code.

I am working with .py files so the syntax highlighting works only for Python commands and the whole text (inside quotes) is treated as string in VS Code.

Is there any fix to get syntax highlighting like Sublime Text / Atom in VS Code when working with SQL syntax in .py files or highlighting commands even if it's inside quotes ("")?

1 Answer 1

8

It seems the VS Code doesn't support this feature officially. Hence, I make an extension called Highlight String Code which can highlight SQL expressions in Python or any other language.

You can easily use it by uppercasing the first keyword of the SQL command and adding a semicolon at the end:

enter image description here

I hope the extension can be helpful.

Sign up to request clarification or add additional context in comments.

2 Comments

brilliant extension! Works right away, thanks a lot!
great extension. You saved my day!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.