vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

Master installation script / convenience function

Open grantmcdermott opened this issue 1 year ago • 6 comments

Is your feature request related to a problem? Please describe.

Setting up a fully-fledged R environment in VS Code currently involves several manual steps, as outlined in the README. Users must first install the languageserver package (from R), then add the REditorSupport extension (from VS Code), and then configure several other add-ons from other locations/sources (e.g. radian via pip in the terminal, httpd from R...).

In my experience, this startup rigmarole is tricky for newcomers and, possibly, even for fairly advanced users. (Example: I explicitly had to add radian to my $PATH on both Linux and Mac before it would work.) Once everything is set up, then VS Code genuinely makes for an excellent R IDE. But it's harder getting to that point than it needs to be IMO.

Describe the solution you'd like

One possible solution is to handle all of these installation requirements via a single convenience script or R function. I'm thinking something along the lines of arrow::install_arrow() and reticulate::install_python() (or even JILL and Homebrew).

Say this functionality was bundled as an R function; call it vscoder_setup(). Users could then pass arguments regarding the installation and configuration that they'd like... although I'd argue that the full enchilada of recommended steps—including the debugger plugin and radian—be installed as a default.

Describe alternatives you've considered

Apart from the current manual approach, none.

Additional context

#718 is somewhat related. Again, however, my goal is to provide a single convenience function that I can give to students and colleagues that sees them off to the races with minimal effort or assumed knowledge on their part.

Thanks for considering!

grantmcdermott avatar Jul 28 '22 21:07 grantmcdermott

I think a generalized approach to doing this is to use VSCode Remote-Containers (or simply devcontainer CLI). https://github.com/microsoft/vscode-dev-containers/blob/6d4aa3a6f1dd2069ef6fc8f8f333213d86eb4165/containers/r/.devcontainer/Dockerfile

eitsupi avatar Jul 29 '22 00:07 eitsupi

@grantmcdermott Another approach is building a Docker image with JupyterLab + R + code-server + ...

Log into https://demo.jupyter.b-data.ch with your GitHub account and start Image R (verse:latest) + code-server.

You may also run registry.gitlab.b-data.ch/jupyterlab/r/verse locally like the official Jupyter docker images: https://github.com/jupyter/docker-stacks#quick-start


See also https://gitlab.b-data.ch/explore/projects/topics/JupyterLab. ℹ️ Multi-arch (linux/amd64, linux/arm64/v8) Docker images with code-sever + R | Python | Julia + ...

benz0li avatar Jul 29 '22 11:07 benz0li

Thanks both. I agree the containerized options are nice and I personally make use of them a lot in my own workflow.

But again, I'm looking to accommodate users who will, typically, never have heard of Docker and might even be getting exposed to R and VS Code for the first time. (And me in the middle, trying to convince them to use both!) I'd love to make the setup+installation process for these users as simple as it is for, say, RStudio.

grantmcdermott avatar Jul 29 '22 18:07 grantmcdermott

I think it would be fair to say that one of the main vscode-R goals, at present, is to drastically reduce the barrier to entry. This can be seen for instance in the defaulting of standard vsc-R settings, or the ability to toggle R options via extension settings.

RStudio's onboarding and new user experience is nothing short of exceptional and is something that can (and probably should) be used as a benchmark. @renkun-ken has a nice blogpost discussing this (unfortunately I can't find the link ATM).

As you've outlined, we need to do better with the setup phase. The python extension does a nice job of setting up upon initial installation, and perhaps we need to explore that more.

The selection of rPath and rTerm can also be confusing, and the cognitive overhead should hopefully be reduced in an upcoming PR.

Hopefully more to come in making this a more inviting experience :)

ElianHugh avatar Jul 30 '22 01:07 ElianHugh

Hopefully the work the devs are doing to bring full multiroot support so that R in VSCode operates just like python will make things better, because the python side is really easy to get going, and R should be the same

hermidalc avatar Aug 19 '22 11:08 hermidalc

And sorry but maybe I'm an idiot, but I've never gotten vscode-R to work. I follow the README and have all the requirements installed. I specify the rterm and rpath to fixed binary paths in my settings, but nothing works, you cannot attach an R terminal in VSCode, it doesn't do any syntax checking, really it just doesn't seem connected to R and radian at all. I'm simply not understanding because honestly how can anyone do these simple steps wrong.

Is it because my R, radian, languageserver, httpgd are in a single conda environment? I remember also trying to install these into system paths via my linux dnf package manager, but remember it also didn't work at all. How did other people get things to work?

hermidalc avatar Aug 19 '22 12:08 hermidalc

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

github-actions[bot] avatar Aug 20 '23 01:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Sep 03 '23 01:09 github-actions[bot]