i type it out
it puts in firstname.lastname@example.org in my worksheet
it puts in select * from in my worksheet
if i type ss or cont - and hit ctrl space, it shows the possible hits vs replacing, even if there's 1 hit
Agreed this the the current behavior in 4.1., but in 4.0 this was different. Probably this is a side effect of the changed code completion insight functionality. If I compare 4.1 to 4.0 the suggestion list after ctrl-space is longer in 4.1 than 4.0. So it probably only works if there is exactly 1 hit in the list. Still this defeats to a certain degree the SQL editor code templates functionality. I am a lazy programmer so typing code with the least amount of keyboard AND mouse actions is ideal.
Maybe in a future release it is possible to implement the SQL editor code templates functionality like I am used to in PL/SQL Developer and TOAD. In these tools you just define a list of autoreplace string value pairs, e.g. ssf = select * from table. Then autoreplace is triggered by a space after typing the abbreviation. This distinct separation between autoreplace or SQL editor code templates and code completion insight offers more flexibility and to me a more intuitive experience.
I don't think we'll ever auto replace - the 'auto' bits are what annoy users the most about our code helpers.
Can I get a screenshot of your sql template popup suggestions with what you have at the cursor? If the suggestion list has more than it should, that would be a bug. As in, if we can make a better guess, we should.
I have 3 'beer' templates
if I type bee and hit ctrl+space, all 3 come up in a popup
if i type beer3, the popup comes up with just the one hit
if i type beer3 and hit ctrl+space, it auto replaces the text with the correct template
Seems like we can have it both ways here?
Your 3 beers example exactly demonstrates the point I would like to make. I agree with the behavior with all 3 usages you demonstrate. But what if I type "beer" then I would like it replaced with the text defined for template "beer" instead of showing me a list with beer, beer2 and beer3. The screenshot below show what I mean in my SQL Dev. 4.1:
So if the string I type matches exactly 1 entry in the list why not do the replace instead of showing me the list?
because it's matching everything that starts with that string