11 Replies Latest reply on Mar 21, 2018 3:56 PM by thatJeffSmith-Oracle

    Template auto-replace - reaction speed

    John_K

      I have templates defined such as "ssf = select * from". I use the auto replace option. That works fine in principle - however it doesn't react fast enough.

       

      There is about half a second after typing the space after "ssf" until the text expands. so if I type any faster than that, it gets missed completely. I'm not a massively fast typist, however hit this pretty much every time. My system is Pentium i7 with 16GB RAM, nothing much else running, so should be able to handle it. See the below video for an example. So my question is - am I able to tweak this response time anywhere? If not, then I'm assuming it's a bug?

       

      https://www.youtube.com/watch?v=iCGWxYbHr4M&feature=youtu.be

        • 1. Re: Template auto-replace - reaction speed
          Günter

          Or use Ctrl+Spacebar

          • 2. Re: Template auto-replace - reaction speed
            John_K

            This relates to templates, not completion insight. However - I have set the above to the lowest setting anyway and it still doesn't work. Sure, I could use CTRL+Space, however the "Autoreplace" functionality should work - at the moment it doesn't if you type a little too fast.

            • 3. Re: Template auto-replace - reaction speed
              thatJeffSmith-Oracle

              Your solution now is to pause after your template.

               

              What would you propose as the acceptable wait time?

               

              Note that some folks will want some tolerance around accidentally typing a autoreplace string and wanting to backspace to change or....something before the editor throws the text into their code.

              • 4. Re: Template auto-replace - reaction speed
                John_K

                "Your solution now is to pause after your template."

                 

                Yes, this is a workaround.

                 

                What would you propose as the acceptable wait time?

                 

                Why should there be any wait time? If I have set up "ssf" as a replacement string, then as soon as I hit space after ssf I would expect it to expand. Or if there is a need to delay, it should be configurable between 0 and n, as the completion insight is. I guess the latter would be preferable to suit all audiences.

                 

                Note that some folks will want some tolerance around accidentally typing a autoreplace string and wanting to backspace to change or....something before the editor throws the text into their code.

                 

                In which case, surely it should be configurable? I'd be surprised if a user response time is such to notice the mistake, move to backspace and delete the string BEFORE it has expanded. The response time seems to be just a little too slow to allow for a normal typing rate, but a little too fast to be useful as a feature. If anything it's worse now because you type expecting it to expand, you are slightly too quick, then have to go and backspace your tablename to get the expansion to work. From your last comment though, it sounds like you are saying this is a feature? If so, can you say what the default/static response time is?

                 

                Thanks,

                John

                • 5. Re: Template auto-replace - reaction speed
                  thatJeffSmith-Oracle

                  It's a relatively new feature and you're the first to provide feedback here.

                   

                  I'll see what we can do for 18.2 or a future release.

                  • 6. Re: Template auto-replace - reaction speed
                    SebastianKoell

                    I would also prefer a instant replace.

                    For me sometimes it works instant and sometimes not (within 30 seconds). No idea why.

                     

                    Just ran a kind of reproducable test:

                    If I have an empty worksheet it replaces instantly.

                    If I now add an annonymous block:

                    declare

                    begin

                    end;

                    /

                     

                    Now if I try autoreplace in this worksheet sometimes it's instant and sometimes not. I kind of have the feeling it has sth to do with the line you are trying it ... Inside or right after the block it fails. Outside it often works.

                    1 person found this helpful
                    • 7. Re: Template auto-replace - reaction speed
                      John_K

                      I agree - I have also seen it appear to slow down once you get more code in the sheet. I'm wondering if perhaps it is parsing the full worksheet backwards from the cursor or something similar, rather than just backwards as far as it needs to?

                       

                      The other thing I noticed is that sometimes it doesn't expand at all. If for example you have a sequence set up to replace "ssf" with "select * from" and you type "ssf " then backspace the space and add it in again, the expansion isn't picked up if you do it quick enough. So kind of related to above, but without typing the table name.

                       

                      Here is a quick example.

                       

                      https://youtu.be/E3YFaMzyVi0

                       

                      Interestingly, I can also type "ssf " sufficiently fast to make it not even recognise that (without backspacing or anything), however as soon as I try and record the screen, I can't get it to fail. It's a heisenberg effect .

                      • 8. Re: Template auto-replace - reaction speed
                        thatJeffSmith-Oracle

                        We can build a test case/bug report out of this - thanks for the detective work.

                        • 9. Re: Template auto-replace - reaction speed
                          John_K

                           

                          Thanks. I thought I'd update to the latest version and check it there - when I did, I noticed this:

                           

                           

                           

                          2018_03_20_13_02_35_Check_for_Updates_Step_1_of_4.png

                           

                          copy and paste error?

                          • 10. Re: Template auto-replace - reaction speed
                            John_K

                            Sorry to be a pain on this, I found another issue with this. It's a feature I use literally all the time in other development tools, hence why it's a big deal to me.   Auto Replace only seems to work if the current SQL query is valid - including blanks. So if I have a statement lower down in my editor, I can't use auto replace further up in the editor without a semicolon to terminate that statement. Example here:

                             

                            https://youtu.be/yQHee-iF34c

                            • 11. Re: Template auto-replace - reaction speed
                              thatJeffSmith-Oracle

                              the parser is always involved - we're just not a 'dumb text editor' - but I'll see if it can't be more forgiving with auto-replace on templates like we've done for the formatter in the most recent update...that's a separate issue from the speed