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

Send code from Rmd chunk to terminal #49

Closed
jacob-long opened this issue Feb 5, 2018 · 10 comments
Closed

Send code from Rmd chunk to terminal #49

jacob-long opened this issue Feb 5, 2018 · 10 comments
Assignees

Comments

@jacob-long
Copy link
Contributor

I have a simple question: Is it the intended behavior that I cannot send code from R Markdown code chunks to the integrated terminal? I am returning to VS Code after having used a much earlier version of this extension, and I was thinking this was a feature. I could be confusing it with a Sublime Text extension or something else from when I last tried out various editors for R support.

If this is supposed to work, then I'll submit more information so we can try to figure out why it does not for me.

If this is not a current feature, then I'll submit my suggestion that you add it :)

@Ikuyadeu
Copy link
Member

Ikuyadeu commented Feb 6, 2018

@jacob-long Thank you for using this extension and interest.
Now, this extension does not support Rmd chunk.
How do you think, which is good example R studio or Sublime for Rmd support?

@Ikuyadeu Ikuyadeu self-assigned this Feb 6, 2018
@jacob-long
Copy link
Contributor Author

RStudio is probably the best example of Rmd support, but Sublime's R-Box might be the most useful example to look into. If I recall correctly, R-Box does it like this:

  • If the cursor is at the beginning of the code chunk, right after the ```, then the send to integrated terminal shortcut sends the entire chunk.
  • If the cursor is inside the chunk, then the shortcut for sending to the terminal works like it does inside any R script.
  • I'm not sure what it does if the cursor is outside of all the chunks when the shortcut is used, but hopefully it does nothing.

@Ikuyadeu
Copy link
Member

Ikuyadeu commented Feb 17, 2018

@jacob-long I just simple fix.
You can send rmd source code by shortcut command.
But this command will work whole rmd file if out of ```
More useful fix will later.
Thank you for the issue!

@Ladvien
Copy link
Collaborator

Ladvien commented Apr 19, 2018

Hmm. I'm curious if we can use some commands from the the markdown-preview extension in Visual Studio Code and pull out the R portions sending them to the terminal.

https://code.visualstudio.com/docs/languages/markdown

That'd get us far ahead on the Markdown side.

This is tricky. So, I'm going to take care of open issues first and revisit this request to see how many bumps its gotten.

@andycraig
Copy link
Collaborator

It would be good to have the following commands, which are available in RStudio:

  • Run Current Chunk
  • Run All
  • Run All Chunks Above (not including chunk cursor is in)
  • Run All Chunks Below (including chunk cursor is in)

@audyavar
Copy link

I concur with @andycraig. It would be nice to have run all chunks above/below. This is useful especially if you are trying to render document and debug some code chunk.

@andycraig
Copy link
Collaborator

I am going to work on these:

  • Run Current Chunk
  • Run All
  • Run All Chunks Above (not including chunk cursor is in)
  • Run All Chunks Below (including chunk cursor is in)

@andycraig andycraig self-assigned this Dec 1, 2019
@andycraig
Copy link
Collaborator

Microsoft is working on built-in notebooks for VSCode and I'm hoping some commands like Run All Chunks might be added as part of that. So, I'm going to wait to see what happens.

VSCode issue: microsoft/vscode#90382

VSCode draft PR: microsoft/vscode#90382

VSCode notebook experiment in separate repo: https://github.com/rebornix/notebook-test

@assignUser
Copy link
Contributor

assignUser commented Aug 18, 2020

See #378 #395

This was referenced Oct 24, 2020
@andycraig
Copy link
Collaborator

Closed by #429. Thanks again @renkun-ken!

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

6 participants