Skip to content

Commit f9db5a6

Browse files
committed
Merge branch 'master' into docs/release_scripts
2 parents edd1dd0 + a46f3a8 commit f9db5a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+6172
-2579
lines changed

.readthedocs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
3+
sphinx:
4+
configuration: docs/conf.py
5+
6+
conda:
7+
environment: docs/rtd.yml
8+
9+
formats:
10+
- htmlzip
11+
- epub

.travis.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,26 @@ cache:
66
- $HOME/.cache/yarn
77
- $HOME/.cache/pip
88

9+
env:
10+
global:
11+
- TRAVIS_NVM_VERSION=0.35.2
12+
913
matrix:
1014
include:
1115
- python: '3.5'
12-
- python: '3.6'
13-
- python: '3.7'
16+
env: TRAVIS_NODE_VERSION=10
1417
- python: '3.8'
18+
env: TRAVIS_NODE_VERSION=12
19+
- python: '3.9-dev'
20+
env: TRAVIS_NODE_VERSION=13
1521
- os: osx
22+
env: TRAVIS_NODE_VERSION=12
1623
osx_image: xcode11
1724
language: shell
1825

1926
before_install:
27+
- wget -qO- https://raw.githubusercontent.com/creationix/nvm/v${TRAVIS_NVM_VERSION}/install.sh | bash
28+
- source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
2029
- python3 -m pip install -r requirements/utest.txt
2130
- python3 -m pip freeze
2231
- python3 setup.py sdist
@@ -34,8 +43,3 @@ script:
3443
- python3 -m jupyter serverextension list
3544
- python3 -m jupyter serverextension list | grep jupyter_lsp
3645
- python3 scripts/utest.py
37-
38-
addons:
39-
apt:
40-
packages:
41-
- nodejs

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
## CHANGELOG
22

3+
### `@krassowski/jupyterlab-lsp 1.0.0` (unreleased)
4+
5+
- features
6+
7+
- supports JupyterLab 2.0
8+
9+
### `@krassowski/jupyterlab_go_to_definition 1.0.0` (unreleased)
10+
11+
- features
12+
13+
- supports JupyterLab 2.0
14+
315
### `@krassowski/jupyterlab-lsp 0.8.0` (2020-03-12)
416

517
- features

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ You can contribute to the project through:
1616
- proposing parts of the architecture that can be [extended][extending]
1717
- improving [documentation](#Documentation)
1818
- tackling Big Issues from the [future roadmap][roadmap]
19-
- improving [testing](#Testing)
19+
- improving testing
2020
- reviewing pull requests
2121

2222
[license]: https://github.com/krassowski/jupyterlab-lsp/blob/master/LICENSE
@@ -29,9 +29,9 @@ You can contribute to the project through:
2929

3030
Development requires:
3131

32-
- `nodejs` 8 or later
32+
- `nodejs` 10+
3333
- `python` 3.5+
34-
- `jupyterlab` 1.1
34+
- `jupyterlab` 2
3535

3636
It is recommended to use a virtual environment (e.g. `virtualenv` or `conda env`)
3737
for development.
@@ -164,7 +164,7 @@ is recommended to peruse the [Robot Framework User's Guide][rfug] (and the exist
164164
First, ensure you've prepared JupyterLab for `jupyterlab-lsp`
165165
[frontend](#frontend-development) and [server](#server-development) development.
166166

167-
Prepare the enviroment:
167+
Prepare the environment:
168168

169169
```bash
170170
conda env update -n jupyterlab-lsp --file requirements/atest.yml
@@ -260,7 +260,7 @@ python scripts/combine.py
260260
- If a test suite for a specific language fails it may indicate that you have no
261261
appropriate server language installed (see [LANGUAGESERVERS][])
262262

263-
[languageservers]: ./docs/Language%20Servers.ipynb
263+
[languageservers]: https://jupyterlab-lsp.readthedocs.io/en/latest/Language%20Servers.html
264264

265265
- If you are seeing errors like `Element is blocked by .jp-Dialog`, caused by
266266
the JupyterLab _Build suggested_ dialog, (likely if you have been using

LANGUAGESERVERS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This file has moved to [docs/LANGUAGESERVERS.md](./docs/Configuring.ipynb).
1+
This file has moved to the documentation: [Language Servers](https://jupyterlab-lsp.readthedocs.io/en/latest/Language%20Servers.html) and [Configuring](https://jupyterlab-lsp.readthedocs.io/en/latest/Configuring.html) sections.

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Language Server Protocol integration for Jupyter(Lab)
22

3-
[![Build Status](https://travis-ci.org/krassowski/jupyterlab-lsp.svg?branch=master)](https://travis-ci.org/krassowski/jupyterlab-lsp) [![Build Status](https://dev.azure.com/krassowskimichal/jupyterlab-lsp/_apis/build/status/jupyterlab-lsp?branchName=master)](https://dev.azure.com/krassowskimichal/jupyterlab-lsp/_build/latest?definitionId=1&branchName=master) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/krassowski/jupyterlab-lsp/master?urlpath=lab%2Ftree%2Fexamples%2FPython.ipynb)
3+
[![Build Status](https://travis-ci.org/krassowski/jupyterlab-lsp.svg?branch=master)](https://travis-ci.org/krassowski/jupyterlab-lsp) [![Build Status](https://dev.azure.com/krassowskimichal/jupyterlab-lsp/_apis/build/status/jupyterlab-lsp?branchName=master)](https://dev.azure.com/krassowskimichal/jupyterlab-lsp/_build/latest?definitionId=1&branchName=master) [![Documentation Status](https://readthedocs.org/projects/jupyterlab-lsp/badge/?version=latest)](https://jupyterlab-lsp.readthedocs.io/en/latest/?badge=latest) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/krassowski/jupyterlab-lsp/master?urlpath=lab%2Ftree%2Fexamples%2FPython.ipynb)
44

55
> _This project is still maturing, but you are welcome to check it out, leave feedback and/or a PR_
66
77
Quick Links: **[Installation](#installation) | [Configuring](./docs/Configuring.ipynb) | [Updating](#updating) | [Changelog](./CHANGELOG.md) | [Roadmap](./docs/Roadmap.ipynb) | [Contributing](./CONTRIBUTING.md) | [Extending](./docs/Extending.ipynb)**
88

99
## Features
1010

11-
> Examples show Python code, but most features also work in R, bash, typescript, and [many other languages](./docs/Language Servers.ipynb).
11+
> Examples show Python code, but most features also work in R, bash, typescript, and [many other languages][language-servers].
1212
1313
### Hover
1414

@@ -76,17 +76,16 @@ Open it searching for "Show diagnostics panel" in JupyterLab commands palette or
7676

7777
Either:
7878

79-
- JupyterLab >=1.1.4,<1.2
80-
- JupyterLab >=1.2.4,<1.3.0a0
79+
- JupyterLab >=2,<2.1
8180

8281
And:
8382

8483
- Python 3.5+
85-
- nodejs 8+
84+
- nodejs 10+
8685

8786
## Installation
8887

89-
> For more extensive installation instructions, see the [documentation](./docs/Installation.ipynb).
88+
> For more extensive installation instructions, see the [documentation][installation-documentation].
9089
9190
For the current stable version, the following steps are recommended.
9291
Use of a python `virtualenv` or a conda env is also recommended.
@@ -95,22 +94,20 @@ Use of a python `virtualenv` or a conda env is also recommended.
9594

9695
```bash
9796
conda install -c conda-forge python=3
98-
# or
99-
conda install -c conda-forge jupyterlab=1.2
10097
```
10198

10299
1. install JupyterLab
103100

104101
```bash
105-
conda install -c conda-forge jupyterlab=1.2
102+
conda install -c conda-forge 'jupyterlab>=2,<2.1.0a0'
106103
# or
107-
pip install jupyterlab=1.2
104+
pip install 'jupyterlab>=2,<2.1.0a0'
108105
```
109106

110107
1. install the server extension:
111108

112109
```bash
113-
pip install --pre jupyter-lsp
110+
pip install jupyter-lsp
114111
```
115112

116113
1. install `nodejs`
@@ -147,7 +144,7 @@ Use of a python `virtualenv` or a conda env is also recommended.
147144
```
148145

149146
Please see our full list of
150-
[supported language servers](./docs/LANGUAGESERVERS.md)
147+
[supported language servers][language-servers]
151148
which includes installation hints for the common package managers (npm/pip/conda).
152149
In general, any LSP server from the
153150
[Microsoft list](https://microsoft.github.io/language-server-protocol/implementors/servers/)
@@ -192,7 +189,7 @@ jupyter labextension install @krassowski/[email protected]
192189

193190
### Configuring the servers
194191

195-
We plan to provide a configuration GUI at some time ([#25](https://github.com/krassowski/jupyterlab-lsp/issues/25)), but in the meantime, you can use the instructions for the specific servers as described on their websites (see the table in [LANGUAGESERVERS.md](./docs/LANGUAGESERVERS.md) for links).
192+
We plan to provide a configuration GUI at some time ([#25](https://github.com/krassowski/jupyterlab-lsp/issues/25)), but in the meantime, you can use the instructions for the specific servers as described on their websites (see the [table of language servers][language-servers] for links).
196193

197194
#### I want to hide specific diagnostics/inspections/warnings
198195

@@ -220,3 +217,6 @@ Again, please do check the pycodestyle documentation for specific error codes, a
220217

221218
This would not be possible without the fantastic initial work at
222219
[wylieconlon/lsp-editor-adapter](https://github.com/wylieconlon/lsp-editor-adapter).
220+
221+
[language-servers]: https://jupyterlab-lsp.readthedocs.io/en/latest/Language%20Servers.html
222+
[installation-documentation]: https://jupyterlab-lsp.readthedocs.io/en/latest/Installation.html

atest/00_Smoke.robot

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ Lab Version
99
Root URI
1010
[Documentation] the rootUri should be set in the page config
1111
Should Not Be Empty ${PAGE CONFIG["rootUri"]}
12+
13+
Build Skipped
14+
[Documentation] Pre-flight the page config
15+
Should Be Equal ${PAGE CONFIG["buildCheck"]} ${False}
16+
Should Be Equal ${PAGE CONFIG["buildAvailable"]} ${false}

atest/01_Editor.robot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Force Tags ui:editor
44
Resource Keywords.robot
55

66
*** Variables ***
7-
${MENU EDITOR} xpath://div[contains(@class, 'p-Menu-itemLabel')][contains(., "Editor")]
8-
${MENU JUMP} xpath://div[contains(@class, 'p-Menu-itemLabel')][contains(text(), "Jump to definition")]
7+
${MENU EDITOR} xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(., "Editor")]
8+
${MENU JUMP} xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), "Jump to definition")]
99
${CM CURSOR} css:.CodeMirror-cursor
1010
${CM CURSORS} css:.CodeMirror-cursors:not([style='visibility: hidden'])
1111

atest/Keywords.robot

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ Setup Server and Browser
1818
${home} = Set Variable ${OUTPUT DIR}${/}home
1919
${root} = Normalize Path ${OUTPUT DIR}${/}..${/}..${/}..
2020
Create Directory ${home}
21-
${WORKSPACES DIR} = Set Variable ${OUTPUT DIR}${/}workspaces
21+
Create Notebok Server Config ${home}
2222
Initialize User Settings
23-
${app args} = Set Variable --no-browser --debug --NotebookApp.base_url\='${BASE}' --port\=${PORT} --NotebookApp.token\='${token}'
24-
${path args} = Set Variable --LabApp.user_settings_dir='${SETTINGS DIR.replace('\\', '\\\\')}' --LabApp.workspaces_dir\='${WORKSPACES DIR.replace('\\', '\\\\')}'
25-
${ext args} = Set Variable --LanguageServerManager.extra_node_roots\="['${root.replace('\\', '\\\\')}']"
23+
${cmd} = Create Lab Launch Command ${root}
2624
Set Screenshot Directory ${OUTPUT DIR}${/}screenshots
27-
${server} = Start Process jupyter-lab ${app args} ${path args} ${ext args} shell=yes env:HOME=${home} cwd=${home} stdout=${OUTPUT DIR}${/}lab.log
25+
${server} = Start Process ${cmd} shell=yes env:HOME=${home} cwd=${home} stdout=${OUTPUT DIR}${/}lab.log
2826
... stderr=STDOUT
2927
Set Global Variable ${SERVER} ${server}
3028
Open JupyterLab
@@ -33,6 +31,21 @@ Setup Server and Browser
3331
Set Global Variable ${PAGE CONFIG} ${config}
3432
Set Global Variable ${LAB VERSION} ${config["appVersion"]}
3533

34+
Create Lab Launch Command
35+
[Arguments] ${root}
36+
[Documentation] Create a JupyterLab CLI shell string, escaping for traitlets
37+
${WORKSPACES DIR} = Set Variable ${OUTPUT DIR}${/}workspaces
38+
${app args} = Set Variable --no-browser --debug --NotebookApp.base_url\='${BASE}' --port\=${PORT} --NotebookApp.token\='${TOKEN}'
39+
${path args} = Set Variable --LabApp.user_settings_dir='${SETTINGS DIR.replace('\\', '\\\\')}' --LabApp.workspaces_dir\='${WORKSPACES DIR.replace('\\', '\\\\')}'
40+
${ext args} = Set Variable --LanguageServerManager.extra_node_roots\="['${root.replace('\\', '\\\\')}']"
41+
${cmd} = Set Variable jupyter-lab ${app args} ${path args} ${ext args}
42+
[Return] ${cmd}
43+
44+
Create Notebok Server Config
45+
[Arguments] ${home}
46+
[Documentation] Copies in notebook server config file to disables npm/build checks
47+
Copy File ${FIXTURES}${/}${NBSERVER CONF} ${home}${/}${NBSERVER CONF}
48+
3649
Setup Suite For Screenshots
3750
[Arguments] ${folder}
3851
Set Screenshot Directory ${OUTPUT DIR}${/}screenshots${/}${folder}
@@ -59,7 +72,7 @@ Open JupyterLab
5972
${firefox} = Which firefox
6073
${geckodriver} = Which geckodriver
6174
Create WebDriver Firefox executable_path=${geckodriver} firefox_binary=${firefox} service_log_path=${OUTPUT DIR}${/}geckodriver.log
62-
Wait Until Keyword Succeeds 20x 3s Go To ${URL}lab?token=${TOKEN}
75+
Wait Until Keyword Succeeds 20x 3s Go To ${URL}lab?reset&token=${TOKEN}
6376
Set Window Size 1024 768
6477
Wait For Splash
6578

@@ -141,15 +154,21 @@ Open With JupyterLab Menu
141154
END
142155

143156
Ensure File Browser is Open
144-
${sel} = Set Variable css:.p-TabBar-tab[data-id="filebrowser"]:not(.p-mod-current)
157+
${sel} = Set Variable css:.lm-TabBar-tab[data-id="filebrowser"]:not(.lm-mod-current)
145158
${els} = Get WebElements ${sel}
146159
Run Keyword If ${els.__len__()} Click Element ${sel}
147160

148-
Rename Jupyter File
149-
[Arguments] ${old} ${new}
161+
Open Context Menu for File
162+
[Arguments] ${file}
150163
Ensure File Browser is Open
151164
Click Element css:button[title="Refresh File List"]
152-
Open Context Menu //span[@class='jp-DirListing-itemText']\[text() = '${old}']
165+
${selector} = Set Variable xpath://span[@class='jp-DirListing-itemText']\[text() = '${file}']
166+
Wait Until Page Contains Element ${selector}
167+
Open Context Menu ${selector}
168+
169+
Rename Jupyter File
170+
[Arguments] ${old} ${new}
171+
Open Context Menu for File ${old}
153172
Mouse Over ${MENU RENAME}
154173
Click Element ${MENU RENAME}
155174
Press Keys None CTRL+a
@@ -164,9 +183,7 @@ Input Into Dialog
164183
Click Element ${DIALOG ACCEPT}
165184

166185
Open ${file} in ${editor}
167-
Ensure File Browser is Open
168-
Click Element css:button[title="Refresh File List"]
169-
Open Context Menu css:.jp-DirListing-item[title="${file}"]
186+
Open Context Menu for File ${file}
170187
Mouse Over ${MENU OPEN WITH}
171188
Wait Until Page Contains Element ${editor}
172189
Mouse Over ${editor}

atest/Variables.robot

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
*** Variables ***
2+
${FIXTURES} ${CURDIR}${/}fixtures
3+
${NBSERVER CONF} jupyter_notebook_config.json
24
${SPLASH} id:jupyterlab-splash
35
# to help catch hard-coded paths
46
${BASE} /@est/
57
# override with `python scripts/atest.py --variable HEADLESS:0`
68
${HEADLESS} 1
7-
${CMD PALETTE INPUT} css:#command-palette .p-CommandPalette-input
8-
${CMD PALETTE ITEM ACTIVE} css:#command-palette .p-CommandPalette-item.p-mod-active
9+
${CMD PALETTE INPUT} css:#command-palette .lm-CommandPalette-input
10+
${CMD PALETTE ITEM ACTIVE} css:#command-palette .lm-CommandPalette-item.lm-mod-active
911
${JLAB XP TOP} //div[@id='jp-top-panel']
10-
${JLAB XP MENU ITEM LABEL} //div[@class='p-Menu-itemLabel']
11-
${JLAB XP MENU LABEL} //div[@class='p-MenuBar-itemLabel']
12+
${JLAB XP MENU ITEM LABEL} //div[@class='lm-Menu-itemLabel']
13+
${JLAB XP MENU LABEL} //div[@class='lm-MenuBar-itemLabel']
1214
${JLAB CSS VERSION} css:.jp-About-version
1315
${CSS DIALOG OK} css:.jp-Dialog .jp-mod-accept
14-
${MENU OPEN WITH} xpath://div[contains(@class, 'p-Menu-itemLabel')][contains(text(), "Open With")]
16+
${MENU OPEN WITH} xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), "Open With")]
1517
# R is missing on purpose (may need to use .)
16-
${MENU RENAME} xpath://div[contains(@class, 'p-Menu-itemLabel')][contains(., "ename")]
18+
${MENU RENAME} xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(., "ename")]
1719
# N is missing on purpose
18-
${MENU NOTEBOOK} xpath://div[contains(@class, 'p-Menu-itemLabel')][contains(., "otebook")]
20+
${MENU NOTEBOOK} xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(., "otebook")]
1921
${DIAGNOSTICS PANEL} id:lsp-diagnostics-panel
20-
${DIAGNOSTIC PANEL CLOSE} css:.p-DockPanel-tabBar .p-TabBar-tab[data-id="lsp-diagnostics-panel"] .p-TabBar-tabCloseIcon
22+
${DIAGNOSTIC PANEL CLOSE} css:.lm-DockPanel-tabBar .lm-TabBar-tab[data-id="lsp-diagnostics-panel"] .lm-TabBar-tabCloseIcon
2123
${DIALOG WINDOW} css:.jp-Dialog
2224
${DIALOG INPUT} css:.jp-Input-Dialog input
2325
${DIALOG ACCEPT} css:button.jp-Dialog-button.jp-mod-accept

0 commit comments

Comments
 (0)