zed icon indicating copy to clipboard operation
zed copied to clipboard

REPL support for Julia

Open biplab37 opened this issue 1 year ago • 9 comments

Check for existing issues

  • [X] Completed

Describe the feature

I would love it if we can use REPL functionalities of zed for Julia languange as well. The website mentions that it supports IJulia but is still working on installation instruction. So my question is that does anyone able to make REPL work for Julia, if yes how did you do it in your case?

If applicable, add mockups / screenshots to help present your vision of the feature

No response

biplab37 avatar Aug 09 '24 11:08 biplab37

@maxdeviant has started looking into this, fixing some amount of protocol divergence in the upstream lib. More to come!

rgbkrk avatar Aug 20 '24 18:08 rgbkrk

Any updates on that? I would really love to use this feature :)

leonfuss avatar Oct 15 '24 12:10 leonfuss

@maxdeviant have you been able to isolate the root cause. Is this issue caused by “zed” or the julia plugin?

asbisen avatar Oct 27 '24 08:10 asbisen

Also looking forward to this.

mashu avatar Nov 20 '24 19:11 mashu

Zed 0.166.1 still has this problem. I can confirm this does not work on Linux either. Zed gets stuck trying to connect to the Julia kernel.

alvgaona avatar Dec 29 '24 03:12 alvgaona

I've discovered that this issue has already been fixed in IJulia's master branch about two months ago. The problem wasn't with Zed itself, but rather with IJulia not fully complying with the Jupyter Kernel Transmission Protocol - specifically, the timestamp in header files was missing the timezone appendix, causing Zed's REPL loop to quit silently (without any traces in the logs).

The fix is in this commit

Until a new IJulia release is published, you can use the current master version with: Enter Pkg Mode by pressing ] after opening Julia in the shell

add IJulia#master
build IJulia

Return to Julia REPL with backspace

# In Julia REPL
using IJulia
installkernel("Julia", "--project=@.")

@maxdeviant This should resolve the issue. I recommend closing this ticket as the underlying problem has been identified and fixed upstream.

leonfuss avatar Mar 22 '25 22:03 leonfuss

As initial bug request. Can someone provide all steps required to make this working ? Out of curiosity, also why upstream patches are needed when this works in vscode, Jupiter and iirc Emacs ?

mashu avatar Mar 23 '25 00:03 mashu

The issue occurs because Zed implements a stricter validation of the Jupyter protocol than some other editors. Specifically, Zed (chrono - serde_json implementation) expects timestamp headers in the Jupyter messages to include timezone information, exactly as specified in the protocol. VS Code, Jupyter, and Emacs either implement more lenient parsing of these messages or handle the missing timezone information differently.

@mashu As for all required steps: Just follow the REPL install instructions here and continue afterwards with the instructions I wrote above. As soon as IJulia makes a new release those steps are obsolete.

leonfuss avatar Mar 23 '25 15:03 leonfuss

Works for me now, however, the IJulia based REPL is much slower than what i was used to in vscode, also there just running a file in the integrated terminal and then being able to run some lines in the terminal is really nice. Its pretty much the only reason I havent switched full time to Zed yet. Is this something that is being planned, or is this something that would need to be done by the Julia plugin?

pleibers avatar May 09 '25 13:05 pleibers

Seems to work to me too for script-as-notebook style usage. Being able to switch to a terminal-like REPL like view on the same Julia process would be nice. I think this is the relevant discussion: https://github.com/zed-industries/zed/discussions/23370

frankier avatar Jun 21 '25 11:06 frankier