As you’re typing…wait, we have to type? Well, just a little bit. Because as it turns out, our modern tools know what we’re going to say, even before we say it!
Let’s take a quick look at our SQL Developer extension in VS Code offer to complete:
- the schema prefix
- our table/view
So there’s two ways to get the helpers. You can:
- do nothing, it just happens
- you can ask for Database help with ctrl+spacebar
Option 1 will almost always be good enough, but if you know there’s better advice to come, from say the data dictionary, you can ‘force it’ with the keyboard request.
If you came from SQL Developer “Classic” you’ll remember that the editor there doesn’t support offering completion help based on the contents of your editor. But, VS Code DOES support that. This item alone might be enough to consider making a switch when you’re doing serious coding work.
We can even get help with our data types when creating a table –
How about PL/SQL?
Yup, that’s supported too!
Let’s try to invoke a PL/SQL program, for example, ORDS.CREATE_SERVICE, from a SQL Worksheet.
Should we format this code block by default? Leave a comment with your thoughts…
Here’s another one, I’m writing a Cursor block, and I need help with the SQL, can our extension help with that? Note that I have a procedure open from the database, but this would work from any file that our extension recognizes.
But Jeff, that’s not working for me!??
The biggest culprit I’ve seen so far here, is a conflict from another extension. This is more likely if you have a file open and that file type is being ‘claimed’ by another extension. The easiest way to test this is look for other database themed extensions and try disabling them.
You should also see the ‘SQL Developer’ toolbar buttons and connection status artifacts on screen…if NOT, then our extension isn’t active for your file/editor.
Here’s what that looks like for PL/SQL sources –
I don’t like getting all these…extra suggestions!
It sounds like you’re seeing advice pop in from our extension supplied SQL Snippets.
In VS Code Preferences, see this option –
What’s that look like, when it’s on? Well, since I have the advice from snippets sorted to ‘bottom,’ I have to look for them, but they’d show like this –