Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions scripts/install-lsp-features/on-jupyter-server-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ pip install jupyterlab-lsp \
# https://jupyterlab-lsp.readthedocs.io/en/latest/Language%20Servers.html
jlpm add --dev bash-language-server dockerfile-language-server-nodejs

# Install sagemaker sdk & scikit-learn onto jlab server for source code jump to definition
pip install sagemaker scikit-learn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess difficult to know where to draw the line on what libraries to install for this purpose... Would be ideal if jupyterlab-lsp could properly use the kernel environments instead, but agree demoing sagemaker + one third-party could be a nice compromise to show users what's possible

# Create an lsp symlink directory so jupyterlab-lsp can open source-files not found in user home directory
mkdir .lsp_symlink
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails on 2nd run onwards because the folder already exists.

When I tried adding the -p flag to allow this, I got an error in the line below due to the target already existing and being a (symlink to a) directory:

ln: failed to create symbolic link ‘.lsp_symlink/opt/opt’: Permission denied

So instead I'm currently testing with:

rm -rf .lsp_symlink && mkdir .lsp_symlink

ln -s /opt .lsp_symlink/opt
# Enable opening of symlink files found in the hidden directory `.lsp_symlink/`
echo yes | jupyter server --generate-config
sed -i '1i c.ContentsManager.allow_hidden = True' .jupyter/jupyter_server_config.py


# This configuration override is optional, to make LSP "extra-helpful" by default:
CMP_CONFIG_DIR=.jupyter/lab/user-settings/@krassowski/jupyterlab-lsp/
CMP_CONFIG_FILE=completion.jupyterlab-settings
Expand Down