Open perllaghu opened 1 year ago
OK, getting there.....
npm install -g typescript-language-server
In this case, I created a file called typescript-language-server-implimentation.json
, and put it in typescript-language-server-implimentation.json
. The contents of that file are:
{
"LanguageServerManager": {
"language_servers": {
"typescript-language-server-implimentation": {
"version": 2,
"argv": ["/opt/conda/bin/typescript-language-server", "--stdio"],
"languages": ["typescript", "javascript"],
"mime_types": ["text/typescript", "text/x-typescript", "text/javascript", "text/x-javascript"],
"display_name": "Typescript/Javascript server"
}
}
}
}
With a .ts
file loaded, the footer menu is saying ... initializing
, however the list shows it Connected
. Whilst I'm getting tab-completion, I'm not getting any of the hinting or auto-completion that I get from the python-lsp-server
Do you need to use the jupyter/minimal-notebook:python-3.9.13
?
For me it worked by using the standart ferdora image, then creating a virtual environment and within that install all jupyterlab and lsp as well as the language server.
Heres the example:
FROM docker.io/library/fedora:latest
# ------------------------------
# install os libs
# ------------------------------
RUN dnf update -y && \
dnf install -y python3-pip python3-virtualenv wget python3.8 htop && \
dnf clean all
# ------------------------------
# add and use jupyter user
# also switch workdir
# ------------------------------
RUN useradd -ms /bin/bash juppy
USER juppy
WORKDIR /home/juppy
# make dir where host files can appear
RUN mkdir hostshared
# ------------------------------
# install jupyterlab and extensions
# ------------------------------
RUN virtualenv venv_juppy && \
source venv_juppy/bin/activate && \
pip install 'jupyterlab>=3.0.0,<4.0.0a0' jupyterlab-lsp && \
pip install 'python-lsp-server[all]' && \
pip install jupyterlab-code-formatter black isort && \
pip cache purge && \
deactivate && \
ln -s / .lsp_symlink
# ------------------------------
# install different venvs
# and have them as kernels in the lab
# ------------------------------
# Evolution venv
RUN virtualenv venv_evolution && \
source venv_evolution/bin/activate && \
pip install --upgrade pip && \
pip install numpy matplotlib && \
pip install ipykernel && \
python -m ipykernel install --user --name venv_evolution && \
pip cache purge
# ------------------------------
# Final run cmd
# ------------------------------
# generate runscript
RUN echo "source venv_juppy/bin/activate && jupyter-lab --ContentsManager.allow_hidden=True --no-browser --ip 0.0.0.0 --port 8080" > juppy.sh
RUN chmod +x juppy.sh
CMD ["/home/juppy/juppy.sh"]
I then compile and run the container with podman, but docker should be like
docker build --no-cache -t juppy:latest -f juppy.dockerfile .
docker run -p 8080:8080 -v "${PWD_TO_BE_SHARED}":/home/juppy/hostshared:Z -i -t juppy bash
Description
Trying to install language servers into a dockerised notebook-server, and jupyterlab-lsp is not able to find the language server
For clarification, notebook servers are run in a cluster, and "home directories" are mounted from an external filestore - this means I cannot install libraries under
$HOME
, or assume any such files may exist.Reproduce
My testing Dockerfile is:
docker build -t test .
&docker run -it --rm -p 8888:8888 docker.io/library/test
)Skipped non-installed server(s): ....
in the logging includestypescript-language-server
test.ts
Expected behavior
Having installed the language server, I would expect it to be accessible
Context
node --version ==> v18.15.0 jlpm info typescript-language-server | grep version ==> 3.3.2