Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LSP to the Binder image #26

Merged
merged 5 commits into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ dependencies:
- wheel
# additional packages for demos
# - ipywidgets
- jupyterlab-lsp
5 changes: 5 additions & 0 deletions binder/overrides.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"@krassowski/jupyterlab-lsp:completion": {
"layout": "detail-below"
}
}
9 changes: 9 additions & 0 deletions binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

python3 binder/postBuild
"""
import shutil
import subprocess
import sys
from pathlib import Path
Expand Down Expand Up @@ -42,6 +43,14 @@ _("jupyter", "server", "extension", "list")
# initially list installed extensions to determine if there are any surprises
_("jupyter", "labextension", "list")

# install javascript language server for autocompletion and error highlighting
# (typescript-language-server depends on tsutils which requires us to choose typescript version)
_("jlpm", "add", "typescript-language-server", "[email protected]")

# add overrides for LSP settings
SETTINGS = Path(sys.prefix) / "share/jupyter/lab/settings"
SETTINGS.mkdir(parents=True, exist_ok=True)
shutil.copy2("binder/overrides.json", SETTINGS / "overrides.json")

print("JupyterLab with @jupyterlab/plugin-playground is ready to run with:\n")
print("\tjupyter lab\n")