Skip to content

Commit f2ee5eb

Browse files
authored
Merge branch 'features-refactor' into syntax_higlighting
2 parents f0b1ced + 807aae3 commit f2ee5eb

File tree

133 files changed

+3495
-252
lines changed

Some content is hidden

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

133 files changed

+3495
-252
lines changed

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
## CHANGELOG
22

3+
### `jupyter-lsp 0.9.2` (unreleased)
4+
5+
- autodetects the `sql` language server for `.sql` files ([#328][])
6+
- diagnostics are provided by `sqlint` which requires Node 11+
7+
to work well (in contrast to currently required Node 10+).
8+
9+
[#328]: https://github.com/krassowski/jupyterlab-lsp/pull/328
10+
311
### `@krassowski/jupyterlab-lsp 2.0.0` (unreleased)
412

513
- features
614

715
- support for JupyterLab 2.2 ([#301][])
816
- completer now displays server-provided documentation,
917
and a kernel icon for kernel suggestions without type information ([#301][])
18+
- add two icons themes for the completer (material and vscode) ([#322])
1019
- the documentation by the completer can be turned on or off ([#315])
1120
- continuous hinting (Hinterland mode) can be enabled in settings ([#315])
1221
- tokens in which the completer should not be triggered can be changed ([#315])
@@ -33,7 +42,8 @@
3342
[#301]: https://github.com/krassowski/jupyterlab-lsp/pull/301
3443
[#315]: https://github.com/krassowski/jupyterlab-lsp/pull/315
3544
[#318]: https://github.com/krassowski/jupyterlab-lsp/pull/318
36-
[#319]: https://github.com/krassowski/jupyterlab-lsp/pull/318
45+
[#319]: https://github.com/krassowski/jupyterlab-lsp/pull/319
46+
[#322]: https://github.com/krassowski/jupyterlab-lsp/pull/322
3747
[00448d0]: https://github.com/krassowski/jupyterlab-lsp/pull/318/commits/00448d0c55e7f9a1e7e0a5322f17610daac47dfe
3848
[bacc006]: https://github.com/krassowski/jupyterlab-lsp/pull/318/commits/bacc0066da0727ff7397574914bf0401e4d8f7cb
3949
[4e5b2ad]: https://github.com/krassowski/jupyterlab-lsp/pull/318/commits/4e5b2adf655120458cc8be4b453fe9a78c98e061

atest/01_Editor.robot

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ TypeScript
6060
${def} = Set Variable xpath:(//span[contains(@class, 'cm-variable')][contains(text(), 'inc')])[last()]
6161
Editor Shows Features for Language TypeScript example.ts Diagnostics=The left-hand side of an arithmetic Jump to Definition=${def} Rename=${def}
6262

63+
SQL
64+
Editor Shows Features for Language SQL example.sql Diagnostics=Expected
65+
6366
YAML
6467
Editor Shows Features for Language YAML example.yaml Diagnostics=duplicate key
6568

atest/05_Features/Completion.robot

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ Works When Kernel Is Shut Down
3939
# this comes from kernel:
4040
Completer Should Not Suggest %%timeit
4141

42+
Works In File Editor
43+
Prepare File for Editing Python completion completion.py
44+
Place Cursor In File Editor At 9 2
45+
Capture Page Screenshot 01-editor-ready.png
46+
Trigger Completer
47+
Completer Should Suggest add
48+
[Teardown] Clean Up After Working With File completion.py
49+
4250
Autocompletes If Only One Option
4351
Enter Cell Editor 3 line=1
4452
Press Keys None cle
@@ -113,6 +121,61 @@ Triggers Completer On Dot
113121
Wait Until Page Contains Element ${COMPLETER_BOX} timeout=35s
114122
Completer Should Suggest append
115123

124+
Material Theme Works
125+
Configure JupyterLab Plugin {"theme": "material"} plugin id=${COMPLETION PLUGIN ID}
126+
Capture Page Screenshot 01-configured.png
127+
Enter Cell Editor 1 line=2
128+
Trigger Completer
129+
Capture Page Screenshot 02-completions-shown.png
130+
# TabError is a builtin exception which is a class in Python,
131+
# so we should get lsp:material-class-light icon:
132+
Completer Should Suggest TabError
133+
Completer Should Include Icon lsp:material-class-light
134+
135+
VSCode Theme Works
136+
Configure JupyterLab Plugin {"theme": "vscode"} plugin id=${COMPLETION PLUGIN ID}
137+
Capture Page Screenshot 01-configured.png
138+
Enter Cell Editor 1 line=2
139+
Trigger Completer
140+
Capture Page Screenshot 02-completions-shown.png
141+
Completer Should Suggest TabError
142+
Completer Should Include Icon lsp:vscode-class-light
143+
144+
VSCode Dark Theme Works
145+
${file} = Set Variable Completion.ipynb
146+
Lab Command Use JupyterLab Dark Theme
147+
Wait For Splash
148+
Capture Page Screenshot 00-theme-changed.png
149+
Configure JupyterLab Plugin {"theme": "vscode"} plugin id=${COMPLETION PLUGIN ID}
150+
Capture Page Screenshot 01-configured.png
151+
Open ${file} in ${MENU NOTEBOOK}
152+
Enter Cell Editor 1 line=2
153+
Wait Until Fully Initialized
154+
Trigger Completer
155+
Capture Page Screenshot 02-completions-shown.png
156+
Completer Should Suggest TabError
157+
Completer Should Include Icon lsp:vscode-class-dark
158+
Lab Command Use JupyterLab Light Theme
159+
Wait For Splash
160+
161+
Works Without A Theme
162+
Configure JupyterLab Plugin {"theme": null} plugin id=${COMPLETION PLUGIN ID}
163+
Capture Page Screenshot 01-configured.png
164+
Enter Cell Editor 1 line=2
165+
Trigger Completer
166+
Capture Page Screenshot 02-completions-shown.png
167+
Completer Should Suggest TabError
168+
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-monogram
169+
170+
Works With Incorrect Theme
171+
Configure JupyterLab Plugin {"theme": "a-non-existing-theme"} plugin id=${COMPLETION PLUGIN ID}
172+
Capture Page Screenshot 01-configured.png
173+
Enter Cell Editor 1 line=2
174+
Trigger Completer
175+
Capture Page Screenshot 02-completions-shown.png
176+
Completer Should Suggest TabError
177+
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-monogram
178+
116179
*** Keywords ***
117180
Setup Completion Test
118181
Setup Notebook Python Completion.ipynb
@@ -130,7 +193,7 @@ Cell Editor Should Equal
130193
Select Completer Suggestion
131194
[Arguments] ${text}
132195
${suggestion} = Set Variable css:.jp-Completer-item[data-value="${text}"]
133-
Wait Until Element Is Visible ${suggestion} timeout=10s
196+
Wait Until Element Is Visible ${suggestion} timeout=10s
134197
Mouse Over ${suggestion}
135198
Click Element ${suggestion} code
136199

@@ -139,6 +202,10 @@ Completer Should Suggest
139202
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-item[data-value="${text}"]
140203
Capture Page Screenshot ${text.replace(' ', '_')}.png
141204

205+
Completer Should Include Icon
206+
[Arguments] ${icon}
207+
Wait Until Page Contains Element ${COMPLETER_BOX} svg[data-icon="${icon}"]
208+
142209
Completer Should Not Suggest
143210
[Arguments] ${text}
144211
Wait Until Page Does Not Contain Element ${COMPLETER_BOX} .jp-Completer-item[data-value="${text}"]

atest/Keywords.robot

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,15 @@ Place Cursor In Cell Editor At
263263
Enter Cell Editor ${cell_nr} ${line}
264264
Execute JavaScript return document.querySelector('.jp-Cell:nth-child(${cell_nr}) .CodeMirror').CodeMirror.setCursor({line: ${line} - 1, ch: ${character}})
265265

266+
Enter File Editor
267+
Click Element css:.jp-FileEditor .CodeMirror
268+
Wait Until Page Contains Element css:.jp-FileEditor .CodeMirror-focused
269+
270+
Place Cursor In File Editor At
271+
[Arguments] ${line} ${character}
272+
Enter File Editor
273+
Execute JavaScript return document.querySelector('.jp-FileEditor .CodeMirror').CodeMirror.setCursor({line: ${line} - 1, ch: ${character}})
274+
266275
Wait Until Fully Initialized
267276
Wait Until Element Contains ${STATUSBAR} Fully initialized timeout=60s
268277

atest/Variables.robot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ ${CM CURSOR} css:.CodeMirror-cursor
3333
${CM CURSORS} css:.CodeMirror-cursors:not([style='visibility: hidden'])
3434
# settings
3535
${LSP PLUGIN ID} @krassowski/jupyterlab-lsp:plugin
36+
${COMPLETION PLUGIN ID} @krassowski/jupyterlab-lsp:completion
3637
${LSP PLUGIN SETTINGS FILE} @krassowski${/}jupyterlab-lsp${/}plugin.jupyterlab-settings
3738
${CSS USER SETTINGS} .jp-SettingsRawEditor-user
3839
${JLAB XP CLOSE SETTINGS} ${JLAB XP DOCK TAB}\[contains(., 'Settings')]/*[contains(@class, 'm-TabBar-tabCloseIcon')]

atest/examples/completion.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
addition = ''
2+
3+
4+
def add(a: int, b: int):
5+
"""Adds a and b together"""
6+
return a, b
7+
8+
9+
ad

atest/examples/example.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT * FR

azure-pipelines.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ variables:
2525
LINKED_EXTENSIONS: >-
2626
packages/lsp-ws-connection
2727
packages/jupyterlab-go-to-definition
28+
packages/completion-theme
29+
packages/theme-vscode
30+
packages/theme-material
2831
2932
jobs:
3033
- template: ci/job.lint.yml
3134
- template: ci/job.test.yml
32-
- template: ci/job.docs.yml

ci/job.docs.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

ci/job.lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ parameters:
55
activate: source activate
66
pythons:
77
- name: ThreeSeven
8-
spec: '>=3.7,<3.8.0a0'
8+
spec: '>=3.8,<3.9.0a0'
99
lab: '>=2,<3.0.0a0'
1010
nodejs: '>=12,<13.0.0a0'
11-
env_update: conda env update -n jupyterlab-lsp --file env-test.yml --quiet
12-
env_lint: conda env update -n jupyterlab-lsp --file requirements/lint.yml --quiet
11+
env_update: mamba env update -n jupyterlab-lsp --file env-test.yml --quiet
12+
env_lint: mamba env update -n jupyterlab-lsp --file requirements/lint.yml --quiet
1313

1414
jobs:
1515
- ${{ each platform in parameters.platforms }}:
@@ -18,7 +18,7 @@ jobs:
1818
pool:
1919
vmImage: ${{ platform.vmImage }}
2020
steps:
21-
- template: steps.conda.yml
21+
- template: steps.mamba.yml
2222
parameters:
2323
name: ${{ platform.name }}
2424

0 commit comments

Comments
 (0)