Skip to content

Commit

Permalink
Merge pull request #26 from krassowski/add-lsp
Browse files Browse the repository at this point in the history
Add LSP to the Binder image
  • Loading branch information
jtpio authored Jan 4, 2022
2 parents 65adb87 + 33be5fd commit 6c01210
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
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")

0 comments on commit 6c01210

Please sign in to comment.