Vscode-r: vscode doesnt run R code in radian when i hit control enter

Created on 14 Aug 2020  路  3Comments  路  Source: Ikuyadeu/vscode-R

Hello, I just set up radian to run R code. I thought i did everything correctly but I guess might have goofed somewhere. :)

I pip installed radian and it works when I run 'radian' from the windows cmd (I am running windows 10). When I go into vscode and hit control enter it does not execute radian. At first I get an error that says 'There are no open terminals'. When I open a new terminal and repeat control enter, it runs the code in the command prompt but does not open radian first. I wasn't sure if it is possible to have radian launch when the line is executed (similar to how python works with vscode).

Below is the settings in vscode:
"r.rterm.windows": "C:\\Users\\XXXX\\AppData\\Local\\Continuum\\miniconda3\\Scripts\\radian.exe",
"r.rterm.option": [ "--no-save", "--no-restore", "radian" ]
"r.terminalPath": "D:\\R-4.0.2\\bin\\x64\\r.exe"
"r.alwaysUseActiveTerminal": true,
"r.editor.bracesOnNewLine": true,
"r.bracketedPaste": true,
"r.lsp.path": "D:\\R-4.0.1\\bin\\x64",

The vscode extensions I have installed are:
-R
-R Extension Pack
-R LSP Client
-R Tools
-r-vscode-tools

I appreciate any help you all could provide.

bug

All 3 comments

There might be conflicts between the extensions you installed. R, R Extension Pack, and R LSP Client are compatible, but probably not with R Tools and r-vscode-tools. Please try removing R Tools and r-vscode-tools, and remove the settings r.terminalPath, r.editor.bracesOnNewLine which are from removed extensions.

Also, please ensure r.rterm.windows points to the executable path of radian, and r.rterm.option should be empty for radian. And r.lsp.path should be D:\\R-4.0.2\\bin\\x64\\R.exe in your case I guess?

Do you have an R installation with version written to registry? If so, you don't have to specify r.lsp.path, the extension will try to find the R executable in registry.

Your issue should come from "r.alwaysUseActiveTerminal" which will avoid trying to start an R terminal for you but uses the active one. If there's none, it would complain. This is most useful for users who always manage R terminal themselves. If you need the extension to create R terminal on demand, the you should disable it.

@bdeshon I also had some weird issues when I had both vscode-R (R) and R tools installed. Removing R tools fixed the issues.

thanks all! it seemed to work when i removed those packages and i fixed the paths. i appreciate it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michaelHL picture michaelHL  路  3Comments

LePeti picture LePeti  路  4Comments

Nightwingg picture Nightwingg  路  6Comments

Victsz picture Victsz  路  5Comments

gcambray picture gcambray  路  4Comments