mattiasnordin / StataEditor

Stata Editor for Sublime Text 3
47 stars 18 forks source link

update - stata 15 #29

Closed eborbath closed 6 years ago

eborbath commented 6 years ago

Hi,

I have an issue which appeared recently, as you added support for Stata 15. I have both 14 and 15 installed on my computer with Windows 10 Pro. I want to set the default launch to Stata 15. Until now I have used the following setup in the package's user settings:

{
    /* With this setting, an extra line is added when the file is saved (just as in Stata's own do-file editor).
    Without an extra line, the last line of code will not be run in Stata. However, when running
    code directly from the active window in Sublime Text, the last line will always be included,
    even when the file is not saved at all, and regardless of this setting. */

    "ensure_newline_at_eof_on_save": true,

    /* This is the path where Sublime Text will be looking for Stata to launch. For this package to work properly,
    this path must correspond to where your Stata distribution is installed. To change the path, go to
    Preferences -> Package Settings -> StataEditor -> Settings - User, copy this line of code, change the path and save. */

    "stata_path": "C:/Program Files (x86)/Stata15/StataSE-64.exe",

    /* Current Stata version. This makes sure Sublime Text is sending code with the correct encoding to Stata.
    Windows-1252 is used for Stata 13 and earlier, while utf-8 is used for Stata 14. */

    "stata_version": 15,

    /* This setting is only for versions 13 and older. Change to appropriate encoding if needed.
    For example, if you use a Chinese version of Stata, change encoding to "gbk". */

    "character_encoding": "windows-1252",

    /* With this setting, all variables in the active Stata connection is available in the completion
    dropdown menu. Change the setting to false to turn it off. */

    "variable_completions": true,

    /* With this setting, Stata functions are available in the completion dropdown menu.
    Change the setting to true to turn it on. */

    "function_completions": false,

    /* With this setting, Stata commands are available in the completion dropdown menu.
    Change the setting to true to turn it on. */

    "command_completions": false,

    /* Setting the directory in Stata when an initial connection to Stata is established.
    The default ("current_path") is to set it to the path of where the current file is located.
    Alternatively, setting the option to "project_path" sets the path where the active Sublime
    project is located. Finally, it is possible to set a custom path (using forward slashes
    instead of backslashes). */

    "default_path": "current_path"
}

This has worked fine with the previous version of the package. However, with your latest update it launches Stata 14, in spite of having specified the correct path for Stata 15 (see above), Any idea what is the issue here? It's Sublime Text 3.

mattiasnordin commented 6 years ago

Yes, I just realized that with the latest update the "stata_path" setting is no longer in use, and I have to test whether it is possible to reintroduce the setting. In the meanwhile, my guess is that you could fix this problem by de-register the Stata 14 automation type library. Please let me know if that works!

eborbath commented 6 years ago

thanks! can you please guide me through on how I do that?

mattiasnordin commented 6 years ago

I just released version 0.10.0 where I have rolled back the changes in version 0.9.0, due to the issue raised in issue #28. Therefore, this should no longer be an issue for you.

eborbath commented 6 years ago

the package did not update, so the issue still exists. I have tried to unregister the stata 14 automation library, and register the stata 15 one as described here. Unfortunately, it did not help and it still launches stata 14.

mattiasnordin commented 6 years ago

The update was released just a couple of hours ago, so it might take some time for the update to kick in. If not, you can uninstall and reinstall stataeditor and it should be working.