Running Stata 17 BE on Visual Studio Code (Mac OS)

Viewed 379

I am trying to run Stata 17 BE on Visual Studio Code (Mac OS). As suggested on this website (https://marketplace.visualstudio.com/items?itemName=Yeaoh.stataRun, I installed stataRun and Stata Enhanced extensions on VS Code and have xdotool and xclip on my Mac. I tried running some simple do-files, but nothing seems to pop up. I played around with Stata path and such, but couldn't get it to work. I would appreciate any help.

1 Answers

To get this working I had to add "StataBE" to the package.json file under 'stataRun.whichApp'. If you run nano ~/.vscode/extensions/yeaoh.statarun-2.0.3/package.json in a Terminal window and then scroll down until you can see stataRun.whichapp, add "StataBE," to that list under "StataSE,". ctrl-x to exit and follow the prompt to save the file.

Back in VSCode, if you click 'Code', 'Preferences', 'Extensions' and 'stataRun', you should see a drop down under 'Which App' - select StataBE. If it doesn't appear, try restarting VSCode first.

Once you've selected that, restart VSCode and you should be able to run Stata. cmd+shift+s will run a selection, and cmd+shift+d will run a whole .do file. Note that this opens up a Stata window rather than running in a Terminal in VSCode.

Related