zed-r icon indicating copy to clipboard operation
zed-r copied to clipboard

unable to run REPL cells with ark

Open r2evans opened this issue 7 months ago • 10 comments

After installing zed, zed-r, and ark, I'm not able to use R. Shutting down the kernel and restarting does not work.

r2@d2mac:~ $ which R
/usr/local/bin/R
r2@d2mac:~ $ R --version
R version 4.4.3 (2025-02-28) -- "Trophy Case"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.

r2@d2mac:~ $ ark --version
Ark 0.1.191
Error: A connection file must be specified. Use the `--connection_file` argument.
r2@d2mac:~ $ ark --install
Successfully installed Ark Jupyter kernelspec.

    Kernel: /Users/r2/Library/Jupyter/kernels/ark/kernel.json
settings.json
{
  "telemetry": {
    "metrics": false,
    "diagnostics": false
  },
  "ui_font_size": 16,
  "buffer_font_size": 16,
  "theme": {
    "mode": "system",
    "light": "One Light",
    "dark": "One Dark"
  },
  "jupyter": {
    "kernel_selections": {
      "r": "ark"
    }
  }
}
Image

macos 15.5, zed 0.190.4 (e486f3e)

r2evans avatar Jun 12 '25 15:06 r2evans

It's been a while since ark didn't work for me as well, although in my case i just get a "Connecting to kernel..." message that doesn't return anything.

You might want to file an issue in ark's repo or check this related issue.

aymennasri avatar Jun 12 '25 15:06 aymennasri

Thanks for the note, @aymennasri. I don't assume that "Connecting ..." and "Kernel error:" are similar enough. Positron is working with Ark, is there a reason to infer that Ark is to blame for this?

If we can determine that some property of Ark (too new, change in behavior, etc) will reproduce this problem, it may be useful to include that condition in the zed-r documentation, at least until the misbehavior is remedied.

Thanks!

r2evans avatar Jun 12 '25 15:06 r2evans

Thanks for the note, @aymennasri. I don't assume that "Connecting ..." and "Kernel error:" are similar enough. Positron is working with Ark, is there a reason to infer that Ark is to blame for this?

In the included url, there is a reply to the issue that I've filed in Ark's repo saying that they also get the Kernel error with the unix_wait_time variable.

The reason for infering that Ark is the reason for this is because it handles the code running part, our extension is more like a definition and rules book for highlighting R code's syntax.

If we can determine that some property of Ark (too new, change in behavior, etc) will reproduce this problem, it may be useful to include that condition in the zed-r documentation, at least until the misbehavior is remedied.

As for this, I'm still waiting for a response from the ark's team as it seems that they are expectedly prioritizing Positron but you can always revert back to older versions of ark or even the stable one and test them out.

Nevertheless, i'll make sure to include this in the documentation.

Let me know if there's any additional info!

aymennasri avatar Jun 12 '25 15:06 aymennasri

I understand, thanks for walking through that with me. Do you know what last version of ark worked without this error? (Or is it "something before 0.1.159"?)

r2evans avatar Jun 12 '25 15:06 r2evans

highlighting R code's syntax

does this mean that zed-r is more of a linter/styler for R code than interactive object discovery? (Sorry, I'm new to LSPs, trying to find alternatives for emacs/ESS.)

r2evans avatar Jun 12 '25 15:06 r2evans

I understand, thanks for walking through that with me. Do you know what last version of ark worked without this error? (Or is it "something before 0.1.159"?)

You might want to test the release with the "latest" tag because all the newer ones are pre releases. As for me, it's been a while since i wrote R code inside Zed; the last time was around March/April so you might want to test ark releases around these two months.

aymennasri avatar Jun 12 '25 16:06 aymennasri

highlighting R code's syntax

does this mean that zed-r is more of a linter/styler for R code than interactive object discovery? (Sorry, I'm new to LSPs, trying to find alternatives for emacs/ESS.)

Not at all, zed-r isn't a just a linter; it does provide full LSP features including object discovery, code completion and hover documentation.

It should work flawlessly but again, ark is the problem here and I'd advice you to stick to Zed as an alternative for emacs as it is as minimal and clutter free as possible.

aymennasri avatar Jun 12 '25 16:06 aymennasri

FYI, all releases are marked as pre-release, nothing is marked as latest, and the instructions here fail for me because https://api.github.com/repos/posit-dev/ark/releases/latest returns a 404. I'll play around.

r2evans avatar Jun 12 '25 16:06 r2evans

They had a release marked as latest, if I remember correctly it might be the mentioned 0.1.159 version. Either way and as I said a release around march and april should be fine.

Let me know if you find a working version and feel free to ask more about zed-r if you want.

aymennasri avatar Jun 12 '25 16:06 aymennasri

I ran into the same issue. Ark version 0.1.174 seems to be the latest that works for me. (Note that you probably need to re-run ark --install after changing to this version.) https://github.com/posit-dev/ark/releases/tag/0.1.174

I'm happy to help debug, but wasn't sure where to get started. Is there an easy way to see the log output of ark when it's being called by this extension?

karldw avatar Sep 28 '25 21:09 karldw

Solved as mentionned in here.

aymennasri avatar Dec 02 '25 19:12 aymennasri