Way to have SQL intellisense or autocompletion inside code strings in Visual Studio Code?

Viewed 2902

In JetBrains IDE's like PHPStorm this is a built-in feature. E.g. in the code below, editing the SQL inside the string would autocomplete as SQL and suggest table/column names from an active database connection.

query("SELECT * FROM users LIMIT 50");

When using Visual Studio Code or similar editors like Theia, this functionality would be supplied by a plugin. Unfortunately, I haven't come across a plugin on the marketplace that has this feature. Some have autocomplete for .sql files, but not inline SQL. It's hard to believe this isn't possible yet in such a popular editor.

Has anyone found a solution for this?

Plugins I've tried so far (I'm specifically looking for Postgres):

1 Answers

You can use this extension. Supports Python, Go, Rust, JS, TS, Ruby, Java, C# and PHP.

Related