Skip to content

Commit 6c01210

Browse files
authored
Merge pull request #26 from krassowski/add-lsp
Add LSP to the Binder image
2 parents 65adb87 + 33be5fd commit 6c01210

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

binder/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ dependencies:
1919
- wheel
2020
# additional packages for demos
2121
# - ipywidgets
22+
- jupyterlab-lsp

binder/overrides.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"@krassowski/jupyterlab-lsp:completion": {
3+
"layout": "detail-below"
4+
}
5+
}

binder/postBuild

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
99
python3 binder/postBuild
1010
"""
11+
import shutil
1112
import subprocess
1213
import sys
1314
from pathlib import Path
@@ -42,6 +43,14 @@ _("jupyter", "server", "extension", "list")
4243
# initially list installed extensions to determine if there are any surprises
4344
_("jupyter", "labextension", "list")
4445

46+
# install javascript language server for autocompletion and error highlighting
47+
# (typescript-language-server depends on tsutils which requires us to choose typescript version)
48+
_("jlpm", "add", "typescript-language-server", "[email protected]")
49+
50+
# add overrides for LSP settings
51+
SETTINGS = Path(sys.prefix) / "share/jupyter/lab/settings"
52+
SETTINGS.mkdir(parents=True, exist_ok=True)
53+
shutil.copy2("binder/overrides.json", SETTINGS / "overrides.json")
4554

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

0 commit comments

Comments
 (0)