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

Support VSCode Notebook API #378

Closed
renkun-ken opened this issue Jul 9, 2020 · 16 comments
Closed

Support VSCode Notebook API #378

renkun-ken opened this issue Jul 9, 2020 · 16 comments

Comments

@renkun-ken
Copy link
Member

We could explore the VSCode Notebook API and see if we could build something out from it.

@DonJayamanne
Copy link
Collaborator

I would like to contribute to this extension and get r vscode working with the Jupyter extension notebook (ipynb).
Basically, the Jupyter extension only deals with opening/saving ipynb files and r extension will be responsible for rich support, execution, language capabilities, etc.

Please advice if such a PR would be welcome and of there's any prior work that I can contribute to or pickup.

@Ikuyadeu @renkun-ken /cc

@Ikuyadeu
Copy link
Member

Ikuyadeu commented Mar 7, 2021

@DonJayamanne Thank you for your suggestion. Of course, we welcome your PR.

Moving notebook functionality to the Jypyter extension helps simplify the role of this extension.
As with Python extensions, we only need to add your plugin to the dependencies.

As an additional future, I hope we can also move the R markdown execution to that extension. (See # 465)
https://code.visualstudio.com/docs/python/jupyter-support-py#_jupyter-code-cells

@DonJayamanne
Copy link
Collaborator

Based on what I can tell, this extension doesn't really start any R kernel.
It just sends R code to the terminal, is that correct.
If that's the case, then I don't think we need to do anything special, as the existing Jupyter R kernel will work with the Jupyter extension in VS Code without any work.

I assumed this extension had its own R kernel (manually spinning up an R process & the like), however that doesn't seem to be the case.

@renkun-ken
Copy link
Member Author

@DonJayamanne #394 is an experimental PR to implement the Notebook API. Only in this PR we implement a simple R kernel that evaluates code from notebook cells.

@DonJayamanne
Copy link
Collaborator

Thanks.

I've had a look at the code & I'm struggling to see the need for spawning a kernel manually.
Please coul dyou try the Jupyter extension and let me know whats missing.
I'm suggesting this because I don't see the need to create a kernel & manually launch it as done in #394.
The only benefit is, a user doesn't need to install a kernel spec. I believe we can get around this by having the R extension register an R kernel in a known location (as done here https://github.com/DonJayamanne/typescript-notebook) & Jupyter extension will pick this and spawn the kernel & communicate with it using the Jupyter protocol.

Thanks. Please could you try using the Native Notebooks in Jupyter extension & let me know what is missing:

  • Install VSC Code Insiders (Not Stable)
  • Install Jupyter extension version 2021.4.xxxx
  • Ensure you have a R Jupyter kernel spec installed on your system
  • Open a Jupyter notebook and select an R kernel (bottom left we display the kernels)
  • Please try with different outputs

@DonJayamanne
Copy link
Collaborator

Actually I take it back, I had a look at the extension and can see a lot of features that would not be available.
I can start on some of the work, however I have zero R skills. Hopefully someone here can unblock me when i get stuck with anything.
@renkun-ken I'll start working on #394 (creating a new branch from that).

@DonJayamanne
Copy link
Collaborator

Should I submit changes to your branch, or should I submit changes to a whole new feature branch in this repo (e.g. notebook or feature/notebook)?
I would like to make incremental changes as opposed to submitting a giant PR with 100 files changed.
This way the changes can be reviewed incrementally and when everything is ready you can merge the notebook branch into the main branch.
Happy to work anyway you suggest.

@renkun-ken
Copy link
Member Author

@DonJayamanne I'm okay with either way, submitting to my branch or creating a new branch on your own, just go ahead with whatever you feel comfortable with.

I'm curious about one thing. If an extension uses the proposed API (e.g. notebook api), then does it require vscode-insider to use other stable features?

@DonJayamanne
Copy link
Collaborator

hen does it require vscode-insider to use other stable features?

For now Proposed API can only be used when debugging or launching vscode with a special command.
So, if the extension is released, then we cannot use proposed API, as it would cause the extension to fall over. The solution would be to put it behind a feature flag or the like & if someone did want to use it, they could launch VS Code with a special CLI arg.

my branch or creating a new branch on your own,

What ever i do will sit behind a feature flag, this way it can be tested in VS Code insiders and we can ship this if users wish to try it out.
Let me first get something working, and we can discuss how and when you would like to ship this.

@jlperla
Copy link

jlperla commented Jul 5, 2021

@DonJayamanne This is very exciting! What is your ballpark plan for this sort of feature? Given the amazing progress you have done with the julia notebooks already, this would be the next big missing link for my university.

@DonJayamanne
Copy link
Collaborator

I've been working on this for a while now, and hit a few issues. My plan is to get this done within the next week or two. But it will be very much in preview. Will try to merge back my changes into this PR sometime this week #394

@cbrnr
Copy link

cbrnr commented May 11, 2022

Given that the notebook API has been in stable for some time now, are there any plans to add R support through this extension? The Python and Julia extensions seem to already support it (since I can select Python and Julia kernels), and it would be great if R was added to that list as well (after all, Jupyter means Julia, Python, and R 😄).

@ElianHugh
Copy link
Collaborator

Hi @DonJayamanne, sorry to bother, I was wondering how far you got into looking into this + if there was any help that I could provide or would be helpful? Last I remember was an issue with the portability of the R kernel

@github-actions
Copy link

This issue is stale because it has been open for 365 days with no activity.

@github-actions github-actions bot added the stale label Jun 19, 2023
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Jul 3, 2023
@benz0li
Copy link
Contributor

benz0li commented Sep 1, 2023

Unstale.

IRkernel should be adapted for this purpose, though. See IRkernel/IRkernel#685.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants