Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug in autocompletion?

    Version 16 of Stata now has autocompletion implemented in the do-editor. There is one aspect of it that I find problematic and that, I think is a bug. It pertains to the automatic insertion of closing braces and quotes. When used with ", (, {, or [ it seems to work fine: you type the opening character, and a balancing closing character appears. When you reach the end of the content that goes between them, you can either reposition the cursor after the closing character, or you can actually type the closing character and Stata will recognize what you are doing and will not insert an extra ", ), }, or ]. This works even when things are fairly deeply nested.

    When you start a reference to a local macro with `, the closing ' is automatically inserted. So far, so good. But when you reach the end of the name of the macro, if you type ', Stata does not seem to recognize that you have just balanced the `. Instead, it now inserts an additional ' character which you then have to delete! Given the frequency with which I use local macros, I'm finding this a real pain. I've tried to think of some rationales for why this might be intentional design, but haven't come up with any. I think it's a bug.

    Any other thoughts? Anybody know a workaround (other than turning off balancing altogether--which I don't want to do)?

    Added:
    Code:
    . about
    
    Stata/MP 16.0 for Windows (64-bit x86-64)
    Revision 02 Jul 2019
    Copyright 1985-2019 StataCorp LLC
    
    Total physical memory:        8.00 GB
    Available physical memory:    1.50 GB
    
    Single-user 4-core Stata perpetual license:

  • #2
    I don't know if the issue has been fixed, but there is a newer version of Stata. Try it and see if the issue persists.

    Code:
    . about
    
    Stata/MP 16.0 for Windows (64-bit x86-64)
    Revision 18 Jul 2019
    Copyright 1985-2019 StataCorp LLC
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 17.0 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Thanks for telling me about the update. But -help whatsnew- doesn't mention it, and when I tried it in the do-editor, the problem is still there.

      Comment


      • #4
        Too bad. You can always hope you will get lucky and the problem has already been fixed! Somebody just wrote me and is having problems with this monstrous program mysteriously bombing in Stata 15. I said I'd like to try it in 16 before putting too much effort into trying to figure out what the problem is.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 17.0 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          It is an oversight. And we are going to fix it in a future update, but not likely the next update. Clyde Schechter, I will let you know when a fix is available internally if you would like to try it before it's available through the update process.

          Comment


          • #6
            Hua Peng (StataCorp) Yes, I would appreciate that. The rate at which I type local macros is probably best denominated in units of "per minute," so this has been a real nuisance for me. I'd be delighted to try out the fix as soon as it's available. Thanks!

            Comment


            • #7
              Hua Peng (StataCorp): I, too, would like to know about any updates to fix this, internal or otherwise.

              However, Clyde Schechter, there is a short-term solution (maybe you're already aware) to make the "per-minute" usage less painful. Turn off autocompletion. In the menu for the Do-file Editor, go to Edit > Preferences > Autocompletion, and deselect "Automatically insert closing braces and quotes". I like using this type of feature in R Studio, for example, but the pain of adjusting for local macros over and over again makes it not worth it until Stata gives us a better solution.

              Comment


              • #8
                In the latest Stata 16 update, Revision 01 Aug 2019, auto-completion behavior of macro open and close pair `' is made to be the same as ()[]{}. See item 2 in

                Code:
                help whatsnew
                Type

                Code:
                update all
                in your Stata 16 command window to apply the update.

                Please let me know if you have any comments or questions.
                Last edited by Hua Peng (StataCorp); 13 Aug 2019, 13:36.

                Comment


                • #9
                  That's great, thanks for the update Hua Peng (StataCorp)!

                  Comment

                  Working...
                  X