aws-samples / sagemaker-studio-lifecycle-config-examples

MIT No Attribution
78 stars 51 forks source link

Add r-languageserver to install-lsp-features example #20

Open jogrue opened 2 years ago

jogrue commented 2 years ago

Hi everyone,

Thank you for providing these examples and templates. I would have one suggestion (or feature request):

Would it be possible to add r-languageserver (or R support) for the language server protocol (install-lsp-features.sh script)?

I tried adding it with these lines:

# Add the r languageserver
conda install -c conda-forge r-languageserver

I also had to remove the -u flag because the script would crash when running the conda install line:

# set -eu # does not work with conda (for r-languageserver)
set -e

This worked then, but when I opened an R script or a Juypter notebook with an R kernel enabled (from here: https://github.com/aws-samples/sagemaker-studio-custom-image-samples/tree/main/examples/r-image), I always got the message that it's connected to the R language server but it was not initialized: fully connected [... but] virtual document stuck uninitialized

So, is there another (preferred) way to add support for R that works (install everything using conda? install only R [using conda] and install the languageserver using Rscript?)

And, ideally, would it be possible to include (working) support for R in the example?

Best, Johann