InseeFrLab / images-datascience

Collection of Docker images to build the data science catalog of the Onyxia project
MIT License
24 stars 22 forks source link

Add package required for R Support in VSCode #101

Closed fBedecarrats closed 1 year ago

fBedecarrats commented 1 year ago

The VSCode documentation for R Support indicates that the following steps are required:

  1. Install R (>= 3.4.0) for your platform. For Windows users, it is recommended to check Save version number in registry during installation so that the R extension can find the R executable automatically.
  2. Install languageserver in R.
    install.packages("languageserver")
  3. Install the R extension for Visual Studio Code.
  4. Create an R file and start coding.

Step 2 was missing which throws the following warning when the user starts to use R: image

I just added one line to install the corresponding package.

Disclaimer: I did not test this line on this specific Dockerfile as it would imply to re-write several of the Github action yamls. However I use it on a Dockerimage that is a child of this one and it works fine.

avouacr commented 1 year ago

HI @fBedecarrats, thank's for the PR. As it is specific to making the R extension in VSCode work, I'd be more enclined to put your command in the VSCode Dockerfile, in the if condition just before the installation of the extension : https://github.com/InseeFrLab/images-datascience/blob/main/vscode/Dockerfile#L25. Could you modify your PR ?

fBedecarrats commented 1 year ago

OK @avouacr , I modified the PR, removing the included lines in r-python-julia dockerfile and adding them instead in the VSCode Dockerfile:

    if command -v R; then \
        code-server --install-extension reditorsupport.r && \
        R -e "install.packages('languageserver')"; \

Note that I DIDN'T TEST THIS MODIFICATION. I don't know how to test this without completely messing up with the workfkow in place, so I didn't.

avouacr commented 1 year ago

Thank's @fBedecarrats. No worries, I just tested it locally and it works. It will be available in our next batch of images, on next Monday.