-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running Stata code from VSCode #397
Comments
That's already been working for a while now. At least in my experience, you just need to set the stata kernel and everything works pretty straightforwardly. |
Last time I looked, Vscode really only supported Python kernels, and it only supported a cell interface, in contrast to a line-based interface like Hydrogen, so I never used it. It would be great to have a pull request to add documentation about how to use in Vscode. |
@amichuda Do you mean it is working in Jupyter Notebooks within Vscode? I was wondering if it could also work like Atom with directly using do-files, getting in-line results and plots pane. @kylebarron The insiders build supports other language kernels than Python. Based on @amichuda's response, I think this also includes stata_kernel as well. And, I agree it would be nice to have it in the docs. For example, as of now, I am having issues getting it to work within Vscode, even though it works with JupyterLab-- but there is nowhere to look for help. |
@hozdenoren if you mean, whether it will work like Hydrogen, then no. it won't inline. But it does work within the standard Does that make sense? If you're having trouble having it work, shoot me a message. If it seems like it would be useful, I can write up a short doc |
I think you could make a |
@amichuda Yes, that makes sense! Thanks for the responses! I will message you the issue that I have, not to clutter here. Maybe it could be useful for writing the doc. |
Hi, @kylebarron Is this anywhere to set the output font size in a jupyter env? I am using vscode now and something the results were wrapped and not very readable. It seems like all long results are wrapped and no horizontal scroll can not be triggered, which is something has been happening in Jupyter Lab as well. |
@kylebarron Is there a known issue. It seems like plots won't show up in vscode: |
You're welcome to look into it and make a Pull Request. |
@kylebarron seems like this is a Stata 17 related issue #394 Sorry I forgot to mention I use Stata 17. |
Graphs work for me with Stata17 after I updated with the files in the PR.
…On Mon, Jul 19, 2021, 21:46 StevenLi-DS ***@***.***> wrote:
@kylebarron <https://github.com/kylebarron> seems like this is a Stata 17
related issue #394 <#394>
Sorry I forgot to mention I use Stata 17.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#397 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANSNNL3WEXPEJ5DUA5KBZLLTYRXI3ANCNFSM5AJGCLRQ>
.
|
Hi everyone, I don't know if anyone wants to see this but it appears that we not only can execute Stata from VSCode, we can also run it on GitHub remote server using Codespaces. At least using Stata 15 works for me. Thank you @kylebarron for making this library. Really cool! |
Not a developer, but I think since the stata kernel is technically installed within your python environment, you need to have python chosen to actually run the stata. When you choose stata, it just highlights the code, but there's no actually kernel associated with it |
To me, that says that VSCode still might not really support Jupyter kernels in languages other than Python. Under the hood, Stata Kernel uses Python with a special "entry script". So when you're looking at a Python file, VSCode probably suggests all environments that run using a Python executable. Not sure how this works in VSCode, but in Atom there had to be an agreement between the syntax highlighting package and the code running package on the name of the language. I.e. maybe there's something in either the jupyter package or the stat syntax highlighting package in VSCode that needs to change to tell vscode "this language can be used with this jupyter kernel". |
This shouldn't really be the case. It's true that the stata kernel runs on top of Python, but it presents itself to Jupyter as an entirely different language. So it's probably VSCode not understanding that Stata the syntax highlighter and Stata the jupyter kernel are the same and should be used together. |
I have no idea how that works in vscode, and it's certainly not implemented in Stata kernel. So an empty variable display is probably expected |
Thank you for your clarification! I tried again this morning and find that it works with Stata kernel and Stata language this time. My friends also have similar problems with using stata kernel and stata language mode. Sometimes it works and other times it doesn't and must use stata kernel and python language mode. |
Now that the VSCode supports Jupyter kernels (at least in the insider's edition), I was wondering if it would be possible to leverage it to use Stata in VSCode via stata_kernel as we do in Atom?
The text was updated successfully, but these errors were encountered: