REditorSupport / REditorSupport/vscode-R

Functionality not working with devcontainer

Open
#1,406 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
When running the extension in a devcontainer, I cannot view plots/tables, use the workspace viewer, or use the rstudioapi functions.

When using the View() function, nothing happens.

For the workspace viewer, the following message appears "R workspace viewer requires that the session watcher be enabled."

For the rstudioapi, I get the following message
Error in request_response("rstudioapi", action = action, args = list(...)) : Did not receive a response from VSCode-R API within 5 seconds.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Dockerfile using rocker/tidyverse:4.3 image with the following packages installed: cmake libsodium-dev ssh odbcinst1debian2 libodbc1 odbcinst unixodbc libsecret-1-0 libgsl-dev
  2. Create a docker-compose.yml with the following code

services:
  container_dev:
    image: docker_image
    container_name: container_dev
    volumes:
      - .:/code
  1. In .devcontainer/, create a devcontainer.json file with the following code
{
	"name": "docker-container",
	"dockerComposeFile": [
		"../docker-compose.yml",
		"docker-compose.yml"
	],
	"service": "container_dev",
	"workspaceFolder": "/code",
  "customizations": {
    "vscode": {
      "extensions": [
        "ms-azuretools.vscode-docker",
	"REditorSupport.r",
        "GitHub.vscode-pull-request-github",
        "eamodio.gitlens",
        "streetsidesoftware.code-spell-checker",
        "mutantdino.resourcemonitor",
        "Gruntfuggly.todo-tree",
        "DavidAnson.vscode-markdownlint",
        "Asuka.insertnumbers"
      ]
    }
  }
}
  1. In .devcontainer/ create a docker-compose.yml file
services:
  container_dev:
    volumes:
      - ..:/workspaces:cached
    command: /bin/sh -c "while sleep 1000; do :; done"

Can you fix this issue by yourself? (We appreciate the help)

No

(If yes,) can we assist you with anything?

(If applicable) Please attach setting.json

{
  "r.sessionWatcher": true,
  "r.session.useWebServer": true
}

Expected behavior
Be able to view plots/tables when using View() function, be able to use rstudioapi functions that are implemented for vscode, and be able to see workspace in workspace viewer.

Screenshots
image
image

Environment (please complete the following information):

  • OS: Ubuntu 22.04.2 LTS
  • VSCode Version: 1.78.2
  • R Version: 4.3
  • vscode-R version: 2.8.1

Additional context
Add any other context about the problem here.

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

Reproduce the issue using the Dockerfile, docker-compose.yml, .devcontainer/devcontainer.json, and the reported r.sessionWatcher and r.session.useWebServer settings. Start by tracing the session watcher, web server, and devcontainer integration paths involved in View(), the workspace viewer, and rstudioapi requests. Done means all three functions work in the described devcontainer setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, r, typescript
Domain
developer-experience, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.