myst-vs-code icon indicating copy to clipboard operation
myst-vs-code copied to clipboard

Add Code Execution capability for MyST

Open teonbrooks opened this issue 5 years ago • 4 comments
trafficstars

Is your feature request related to a problem? Please describe. It would be great if we could adapt the code execution for Python chunks using the similar implement as vscode-python. With that extension, you could press Cmd+Enter to run the code within the kernel in the editor. This would give a great level of interactivity while writing in MyST.

Describe the solution you'd like Add code execution capability to MyST extension.

Describe alternatives you've considered It may be more desirable to add this directly vscode-python. It currently supports jupyter notebook and python scripts with percent sign code chunk delimiters (%%). perhaps the addition of ```python syntax there would be more applicable.

teonbrooks avatar Jul 08 '20 16:07 teonbrooks

thanks @teonbrooks 100% agree, and actually I have wrote a much more "in-depth" language server extension, using python-language-server., for rST that I would like to port more of into here: https://github.com/chrisjsewell/rst-language-server. Just have to find the time!

chrisjsewell avatar Jul 08 '20 17:07 chrisjsewell

It may be more desirable to add this directly vscode-python

I opened an issue in vscode-python about this, but haven't received a lot of attention.

https://github.com/microsoft/vscode-python/issues/13568

I think it would be a lot nicer if the preview included the executed code, though, although not sure if that's the same as this issue.

amichuda avatar Nov 10 '20 00:11 amichuda

@amichuda I created an issue and we've had some conversation in the thread here https://github.com/microsoft/vscode-python/issues/14226. I started to tinker around with it but i haven't had any spare cycles yet to work on it. we could probably collapse this down to one issue and i identify the steps needed to make it happen

teonbrooks avatar Nov 10 '20 03:11 teonbrooks

This looks really promising. Thank you! But is your vision here that it would just run the code in the interactive window? If the markdown were to be rendered in the interactive window as well, it would need to interpret myst markdown right?

In any case, this is looking really good!

amichuda avatar Nov 10 '20 04:11 amichuda