vscode-R
vscode-R copied to clipboard
Functionality not working with devcontainer
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:
- 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
- Create a docker-compose.yml with the following code
services:
container_dev:
image: docker_image
container_name: container_dev
volumes:
- .:/code
- 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"
]
}
}
}
- 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
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.
Does this require python to be installed? I installed it in the container and it looks like it's working now