Skip to content
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

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

Open
DonJayamanne opened this issue Oct 21, 2020 · 26 comments
Open
Assignees
Labels
feature-request Request for new features or functionality interactive-window Impacts interactive window language-any Area covering general issues geared to supporting any language (not just Python)

Comments

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Oct 21, 2020

Workflow

  • User has Julia kernel installed
  • User installs our extension
  • User opens Julia file & creates a cell marker using # %%
  • Code lenses appear allowing user to run cell
  • User runs cell (code) & interactive window appears
  • Jupyter, Python, Python extension not required

Technical details

  • Determine available kernels
  • Based on available kernels, add support for cells code lenses in text editors
  • Super easy to add support for julia, rust, csharp, fsharp, etc..
    (super easy changes to implement this feature)

Support Features

  • Cell commands (run, run above, run below, add, insert, move, etc)
  • Interactive window commands work
  • Restart, interrupt, etc
  • Basic Intellisense in prompt (comes from kernel - hence supported if kernel supports this)

Possible MVP

  • No support for debugging
  • No need of exposing APIs from extension
    • When other languages need features we can expose this API (debugging, variables, etc)
  • Allow users to disable interactive window code lenses in other languages (if they dont need this)
  • Via an experiment

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
Copy link
Contributor

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
Copy link
Contributor Author

@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
Copy link
Contributor

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

@stevenlis
Copy link

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
Copy link
Contributor Author

Yes, that's the plan.

@stevenlis
Copy link

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

@DonJayamanne
Copy link
Contributor Author

@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
Copy link

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
Copy link

TotallyInformation commented Mar 15, 2021

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
Copy link

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

@DonJayamanne
Copy link
Contributor Author

Would be "massively useful" for my workflow

Which language?

@stevenlis
Copy link

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

@greazer greazer added the bug Issue identified by VS Code Team member as probable bug label Jul 8, 2021
@stevenlis
Copy link

@DonJayamanne This feature is still happening, right?

@DonJayamanne
Copy link
Contributor Author

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

@stevenlis
Copy link

😭

@greazer greazer added the language-any Area covering general issues geared to supporting any language (not just Python) label Aug 4, 2021
@rchiodo rchiodo added needs-inspection and removed bug Issue identified by VS Code Team member as probable bug needs-inspection labels Aug 30, 2021
@greazer greazer added the interactive-window Impacts interactive window label Sep 3, 2021
@greazer greazer added the feature-request Request for new features or functionality label May 4, 2022
@adam248
Copy link

adam248 commented Oct 8, 2022

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
Copy link

vetusst commented Dec 3, 2022

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

@RoyiAvital
Copy link

@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
Copy link

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
Copy link

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
Copy link
Contributor

amunger commented Oct 30, 2023

@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
Copy link

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
Copy link

feribg commented Nov 19, 2023

@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
Copy link

RoyiAvital commented Nov 20, 2023

@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
Copy link

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

@albertomercurio
Copy link

I would be great to support Julia.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality interactive-window Impacts interactive window language-any Area covering general issues geared to supporting any language (not just Python)
Projects
None yet
Development

No branches or pull requests