-
Notifications
You must be signed in to change notification settings - Fork 138
Description
Currently, the only way to run R session that will be connected to VSCode by this extension, is to run a remote VSCode server on this machine, and then the R terminal/session is "local" in the sense it's running on the same machine running the VSCode server. This is due the following more general issue:
Currently, this extension connects to the R session via .vsc.attach(), and then VSCode and the R session communicates via temporary files.
While this solution makes the usage of the R plugin simple, it would be problematic in two scenarios:
- Connecting different R sessions on different VSCode backends - currently the attachment mechanism may conflict.
- Connecting to a remote R session - right now the only solution is to execute VSCode remote backend on the same remote machine.
A simple solution that wouldn't ruin the current mechanism is to support communicating with the VSCode instance in two channels - one by the file-system(currently), and the second is by listening to a TCP connection.
This way the R function will become .vsc.attach(port=NULL) and when the port isn't null, it will try to attach by the TCP port.
For the UI, the VSCode extension status-bar display could be changed to "R - (not attached, TCP:PORT_NUMBER)".