poidstotal / stataRun

Provide a Visual Studio Code extension to run code(.do, .ado and command from) for Visual Studio Editor
25 stars 8 forks source link

Sometimes there are errors which get fixed with a "Reload Window" #1

Closed linhtto closed 6 years ago

linhtto commented 6 years ago

Thanks for the package. I got it on my MacOS 10.13.6 and VSCode 1.26.1 recently and have been trying it out. It's very useful for debugging Stata code while staying inside VSCode with Stata being open on the side.

I think if you navigate away from Stata and then back, then there may be errors (there can be other cases too but it's hard to have a systematic list). Two notifications popped up then:

Can not run your selection.

and

Running the contributed command:'extension.runSelection' failed.

The only way I could "fix" this after the errors are shown is to use vscode command "Reload Window". It's quite slow and inconvenient, and it happens quite often. I use this package https://github.com/andrewheiss/SublimeStataEnhanced when I use Sublime, and it does something very similar but I don't recall encountering this same issue.

poidstotal commented 6 years ago

The "Can not run your selection." error is a design, for some situations for example when the selection is empty. for the other error, let me know how frequent you receive this.

Gratitudes Gilbert M.

linhtto commented 6 years ago

I understand regarding when there are actual errors. I'm talking about the case when everything is correct but sometimes it runs and sometimes it breaks after you move away from the stata window and then back, while still working on the exact same code. I hope this helps clarify.

Thanks for checking in and for the package.

poidstotal commented 6 years ago

Version 1.15 may fix your problem. The current editor window was being captured before the activation which cause the first editor content to say in memory when you activated other files. Let me know

Gratitudes Gilbert M.

linhtto commented 6 years ago

It did indeed fix my problem! If anything else happens I can open another issue, but I don't think I can replicate the old problem right now.

Thanks!

poidstotal commented 6 years ago

Fixed in 1.1.5