REditorSupport / REditorSupport/vscode-R

Allow the R `.vsc.attach()` function to connect by TCP to VSCode - supporting remote R sessions

Open
#1,359 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

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:

  1. Connecting different R sessions on different VSCode backends - currently the attachment mechanism may conflict.
  2. 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)".

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the R-side .vsc.attach() implementation and the extension code that currently communicates through temporary files. Trace how attachment state reaches the status bar, then determine the changes needed for a TCP port path while preserving the existing file-system path. Done means remote R sessions can attach by port and the UI displays the TCP port when applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, typescript, vscode
Domain
networking, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.