vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

Run Selection can't handle multi line strings

Open gowerc opened this issue 2 years ago • 6 comments

Describe the bug

When trying to submit the following code snippet only the first line gets submitted (i.e. just the x <- "

x <- "
a
"

For reference Rstudio seems to submit the whole chunk

To Reproduce

  • Create a new file
  • Enter the above snippet
  • Place cursor infront of the x
  • try submitting via ctrl+enter

Can you fix this issue by yourself? (We appreciate the help)

No (sorry)

Expected behavior The whole string gets submitted

Environment (please complete the following information):

  • OS: macOS
  • VSCode Version: 1.75.1
  • R Version: 4.2.2
  • vscode-R version: v2.7.1

gowerc avatar Mar 01 '23 17:03 gowerc

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

github-actions[bot] avatar Mar 01 '24 01:03 github-actions[bot]

Not stale

gowerc avatar Mar 01 '24 09:03 gowerc

I am running into this same issue.

ml-crowe avatar May 16 '24 17:05 ml-crowe

me too

R version 4.1.2 R vs code v2.8.4 vscode 1.90.0

davidmasp avatar Jun 11 '24 23:06 davidmasp

Might be related to this? #731

There they say that another R extension for VS code is messing up this behavior.

I can confirm that when running with the command palette works fine but I don't have any other R extension mentioned in the other issue

davidmasp avatar Jun 11 '24 23:06 davidmasp

okay so i figure it out, I had the same shortcut to send code to the terminal for all file types, basically I used it for bash, when resetting that shortcut it started to work again.

The cmd+Enter shortcut is quite populated so it was a bit hard to find. You can also manually change the shortcut for @command:r.runSelection to anything w/o collisions. For completeness, I think my conflict was coming from @command:workbench.action.terminal.runSelectedText +when:terminalProcessSupported that I manually set some time ago.

davidmasp avatar Jun 11 '24 23:06 davidmasp