microsoft / RTVS

R Tools for Visual Studio.
MIT License
388 stars 118 forks source link

Configure R Interpreter on VSCode Remote (Microsoft.Host.R.Broker.Config.json not found) #4369

Closed majidpk closed 4 years ago

majidpk commented 4 years ago

Hi,

I am using Vscode on a windows machine, and need to work on an R project on a remote linux machine (Centos 7). I have installed R Tools extension on the remote machine, but I keep getting this error: "Unable to find R Interpreter. Please Install R from https://cran.r-project.org".

As per instructions on the extension's detail page, I tried to find "Microsoft.R.Host.Broker.Config.json" file on the remote machine, but it doesn't exist. The closest I could get was:

[root@server ~]# find -name Microsoft.R.Host*
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Host/Linux/Microsoft.R.Host
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Host/Linux/Microsoft.R.Host.RunAsUser
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Host/Mac/Microsoft.R.Host
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Host/Mac/Microsoft.R.Host.RunAsUser
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Host/Windows/Microsoft.R.Host.exe
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Microsoft.R.Host.Broker.deps.json
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Microsoft.R.Host.Broker.dll
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Microsoft.R.Host.Broker.exe
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Microsoft.R.Host.Broker.pdb
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Microsoft.R.Host.Broker.runtimeconfig.json
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Microsoft.R.Host.Client.dll
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Microsoft.R.Host.Client.pdb
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Microsoft.R.Host.Protocol.dll
~/.vscode-server/extensions/mikhail-arkhipov.r-0.0.7/ls/Microsoft.R.Host.Protocol.pdb

As you see in the log, no "Microsof.R.Host.Broker.Config.json" exits. So I tried to create one with the following lines:

{
"server.urls": "https://0.0.0.0:5444",
"R": {
  "Interpreters": {
    "0": {
      "name": "Cran R",
      "basePath": "/usr/lib64/r"
    }  }
}
}

Note: I got the basePath by running R RHOME at the command prompt.

So, basically I need to know how to configure R interpreter with this configuration (VSCode on Windows + debugging R code on remote Centos 7 linux).

I searched thru the current issues, such as #3265 , but couldn't find answers.

MikhailArkhipov commented 4 years ago

I think you mean VS Code. This repo is about regular Visual Studio. See https://github.com/MikhailArkhipov/vscode-r for VS Code. There is r.interpreterPath setting now.

majidpk commented 3 years ago

Thanks for the reply. I believe this new setting is for Windows only. I am trying to use extension on a Linux remote machine.

Btw, I couldn't find r.interpreterPath setting in Windows extension either, isn't vscode suppose to provide an update button for the extension now? I mean this Github update a couple of days ago isn't reflected as an extension update to vscode?

MikhailArkhipov commented 3 years ago

image And I am not sure what exactly is Windows extension?

Again, for VS Core discussions please refer into my repo. This repo is for Visual Studio only and is no longer supported.