microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.28k stars 287 forks source link

Multi Language Support in Interactive Window (Julia, Rust, CSharp, etc) #273

Open DonJayamanne opened 3 years ago

DonJayamanne commented 3 years ago

Workflow

Technical details

Support Features

Possible MVP

Screenshots of prototype with it working in Julia, Rust, CSharp, fsharp

Screen Shot 2020-10-20 at 18 32 38 Screen Shot 2020-10-20 at 18 41 22
andycraig commented 3 years ago

This sounds great! R and Julia extensions include heuristics to determine what a 'block' of code is. For example, Ctrl-Enter on the first line of a for loop sends the whole for loop to the REPL. It's basically an alternative to the # %% cell approach. If this extension exposed a command that allowed a string to be sent to the Interactive Window, those heuristics could also be used with the Interactive Window. I would be happy to add something like that to this R extension.

It's pretty much what I was talking about here, although I was only thinking about Python at that time: https://github.com/microsoft/vscode-python/issues/14192

DonJayamanne commented 3 years ago

@andycraig Thanks for your feedback.

this extension exposed a command that allowed a string to be sent to the Interactive Window, those heuristics c

This is something we are planning on doing, see here https://github.com/microsoft/vscode-python/issues/14398

andycraig commented 3 years ago

@DonJayamanne Great to hear! I will follow progress on that issue.

stevenlis commented 3 years ago

This seems really existing. Since the notebook UI already supports other jupyter kernels. Does this "multi languages" means supporting any kernels listed in jupyer? https://github.com/jupyter/jupyter/wiki/Jupyter-kernels

DonJayamanne commented 3 years ago

Yes, that's the plan.

stevenlis commented 3 years ago

@DonJayamanne I'm really looking forward to this! It's gotta be a game changer!

DonJayamanne commented 3 years ago

@davidanthoff is this something Julia users would be interested in. FYI here we're using the Julia kernel (Jupyter kernel) and getting most of the stuff working.

davidanthoff commented 3 years ago

So I'm a bit worried that we might be adding too many different ways to execute code from .jl files with this :)

The Julia extension has a pretty comprehensive story for running code that sits in .jl files, including cell support (but with a different cell marker, I think), inline viewing of results inside .jl files etc. I think one major issue would be that if a user has both the Julia and Jupyter extension installed at the same time, it becomes very unclear where code would execute from a .jl file, right?

So my gut feeling right now is that it would make more sense to just generally say that the Julia extension handles everything around .jl files. Curios what @pfitzseb and @zacln think about this?

TotallyInformation commented 3 years ago

Is there a timeline for this feature?

I would really like to use a Node.js/JavaScript capable kernel with vscode-jupyter, it would be massively useful.


OK, discovered for myself, couldn't find it in the documentation which is why I thought you couldn't do it. You need to have VSCode insiders for this to work it seems.

npm install -g tslab
tslab install --version
tslab install
jupyter kernelspec list

Then restart VScode. Then you have access to 2 new kernels for js and ts.

Trying that on the current live version of vscode failed.

stevenlis commented 3 years ago

Would be "massively useful" for my workflow as well. Could you please give us an update?

DonJayamanne commented 3 years ago

Would be "massively useful" for my workflow

Which language?

stevenlis commented 3 years ago

@DonJayamanne R, Julia, Stata. This is the kernel I use most recently: https://github.com/kylebarron/stata_kernel/

stevenlis commented 3 years ago

@DonJayamanne This feature is still happening, right?

DonJayamanne commented 3 years ago

Thanks for expressing the interest in this feature, we haven't prioritized this feature.

stevenlis commented 3 years ago

😭

adam248 commented 1 year ago

Just sending some ❤️ to this feature request... Looking forward to being able to use Rust's Evcxr Jupyter kernel https://github.com/google/evcxr/tree/main/evcxr_jupyter 🥂

vetusst commented 1 year ago

Is there any update on that ? I would be cool to have js kernel support for vscode jupyter

RoyiAvital commented 1 year ago

@davidanthoff , It would be great to have this in Julia. The interactive window of VS Code is much better experience than the code blocks support of the extension.

liudonghua123 commented 1 year ago

Is there a timeline for this feature?

I would really like to use a Node.js/JavaScript capable kernel with vscode-jupyter, it would be massively useful.

OK, discovered for myself, couldn't find it in the documentation which is why I thought you couldn't do it. You need to have VSCode insiders for this to work it seems.

npm install -g tslab
tslab install --version
tslab install
jupyter kernelspec list

Then restart VScode. Then you have access to 2 new kernels for js and ts.

Trying that on the current live version of vscode failed.

For JavaScript on nodejs, I used IJavascript.

GitHunter0 commented 10 months ago

This would be fantastic, a game changer for VScode.

For Julia, for example, I see that we can choose the Interactive Window kernel, but I cannot find an option to send the code from the editor to be evaluated in the Interactive Window.

Is there a way to do that?

amunger commented 10 months ago

@GitHunter0 - it is possible to enable the jupyter.execSelectionInteractive keybinding for other editors by removing the editorLangId == 'python' part of the "when" clause.

It's not officially supported and we don't have a way to support code cells in other editors at this point, but I'd be curious what you think if you try that out.

What are you looking for from the interactive window that the Julia REPL doesn't provide? Just the richer outputs?

GitHunter0 commented 10 months ago

Hey @amunger , sorry for the delay.

Thank you, your shortcut workaround is a nice trick.

What are you looking for from the interactive window that the Julia REPL doesn't provide? Just the richer outputs?

In this case right now just the richer outputs, but having the Interactive Window as the 'universal' VScode REPL will be a really good move.

feribg commented 10 months ago

@amunger

What are you looking for from the interactive window that the Julia REPL doesn't provide? Just the richer outputs?

Well the idea is to use the .jl notebook %% notebook format instead of ipynb, way more VCS friendly without any of the hooks and crappy workarounds.

RoyiAvital commented 10 months ago

@amunger ,

What are you looking for from the interactive window that the Julia REPL doesn't provide? Just the richer outputs?

I find the Interactive Window experience to be better than the Julia extension. The ability to mix MarkDown is a game changer when working on technical scripts. Also the work on cells feels more natural with the VS Code experience.

I wish the Julia Extension embrace this way of defining how cell code behave. Which is like other standard: JupyText.

RoyiAvital commented 6 months ago

Seems to be requested in https://www.reddit.com/r/Julia/comments/11djt48 as well.