REditorSupport / vscode-R

R Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=REditorSupport.r
MIT License
1.07k stars 128 forks source link

Functionality not working with devcontainer #1406

Open fuser-hussein opened 1 year ago

fuser-hussein commented 1 year ago

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:

  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"
      ]
    }
    }
    }
  2. 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):

Additional context Add any other context about the problem here.

fuser-hussein commented 1 year ago

Does this require python to be installed? I installed it in the container and it looks like it's working now

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 365 days with no activity.