Multiline strings are not send to console in one block
Describe the bug
Multiline strings are not send to console in one block.
To Reproduce
x <- "foo
bar"
y <- "
foo
"
z <- '
bar
'
Can you fix this issue by yourself? (We appreciate the help)
No
Expected behavior
Multiline strings should be sent to console in one block.
Environment (please complete the following information):
- OS: Windows 11
- VSCode Version: VSCodium 1.106.37943
- R Version: 4.4.0
- vscode-R version: 2.8.6
I confirm the issue also exists with lastest upstream VSCode:
Version: 1.107.0 Commit: 618725e67565b290ba4da6fe2d29f8fa1d4e3622 Date: 2025-12-10T07:43:47.883Z Electron: 39.2.3 ElectronBuildId: 12895514 Chromium: 142.0.7444.175 Node.js: 22.21.1 V8: 14.2.231.21-electron.0 OS: Windows_NT x64 10.0.22631
Possibly related to https://github.com/REditorSupport/vscode-R/issues/173
You could wrap it using R's raw string literal r"(text)"
x <- r"(foo bar)"
z <- r"(
bar
)"
Thanks.
However, that really seems like a bug to me. We shouldn't need a workaround to send multiline strings to the console. This is not needed e.g. in RStudio or Positron.
BTW, another simpler workaround is enclosing the string in braces.