I have defined the following code templates (among others) in SQL Developer:
- Id:
schapp
template: alter session set current_schema = "[schema_name]";
- Id:
schme
template: alter session set current_schema = "&&_USER";
- Id:
ssooff
template: set serveroutput off
- Id:
ssoon
template: set serveroutput on format wrapped
Unfortunately, in SQL Developer 23.1 auto-completion is not anymore templates' best friend, as the following examples will demonstrate.
Remark: I work with DBA rights, so dictionary queries looking for text matches in object names will find results more often than not.
1/ When I type “sch”, then Ctrl+Space…
Here's how the auto-completion menu looks like in SQL Dev 21.4.3
This looks good. Sure, there are 2 matching objects in the SYS schema which I'm not interested in, but at least the 2 code templates are shown, and they come up first in the menu.
And here's how it looks now in 23.1:
I'll spare you the remaining entries in that menu, they are just as relevant as what is shown here: not only is the entire menu populated with matches that I'm not interested in, but the 2 matching code templates are omitted.
2/ Let's try ssoo now
Above is the auto-completion popup after I've typed “ss”. It looks good: I can see the 2 code templates.
But if I type and additional “o”, and press Ctrl+Space, the menu changes, as follows:
My templates have gone AWOL again, and the menu displays not-so-relevant matching objects instead.
It's only after I've typed in an additional “o” that the 2 templates are listed again in the auto-completion menu.
Following is a view of the Statements tab in the View -> Log panel, after I've typed “sso” and hit Ctrl+Space:
I'm not going into details here, suffice to say SQL Dev 23.1 queries the data dictionary in order to find objects with "SSO" at any position in their names (this is why the menu may contain so many entries in some cases). It looks as though SQL Dev 23.1 ignores code templates whenever any of these dictionary queries return at least one row. :-(
Bottom line: code templates still work in SQL Dev 23.1—if their Ids are chosen in such a way that typing enough of them causes the above-mentioned queries to not find matching objects anymore—but they may be harder to use than before, as typing a longer prefix is now required before auto-completion may work as expected.
Regards,
Boot note: funnily enough, auto-completion seems to work as intended with code templates… but only if used beyond the point in the SQL worksheet where a “Syntax error; Partial parse tree” is reported in the Code Outline panel.