Skip to content

Commit 051b315

Browse files
committed
merge upstream
2 parents 0b93532 + 84121b4 commit 051b315

File tree

101 files changed

+6285
-4468
lines changed

Some content is hidden

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

101 files changed

+6285
-4468
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ https://jupyterlab.readthedocs.io/en/latest/getting_started/issue.html
3737
- Operating System and version:
3838
- Browser and version:
3939
- JupyterLab version:
40+
- Language server and version:
4041

4142
<details><summary>Required: installed server extensions</summary>
4243
<pre>
@@ -53,7 +54,7 @@ You may want to sanitize the paths in the output.
5354
</pre>
5455
</details>
5556

56-
<!--The more content you provide, the more we can help!-->
57+
<!--The more content you provide, the more we can help! Please fill in the below:-->
5758

5859
<details><summary>Troubleshoot Output</summary>
5960
<pre>

.github/workflows/job.test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
matrix:
4343
os: [ubuntu]
4444
nodejs: ['>=14,<15.0.0a0']
45-
lab: ['>=3.0.0,<4.0.0a0']
45+
lab: ['>=3.1.0,<4.0.0a0']
4646
r: ['>=4']
4747
steps:
4848
- uses: actions/checkout@v2
@@ -127,7 +127,7 @@ jobs:
127127
matrix:
128128
os: [ubuntu]
129129
nodejs: ['>=14,<15.0.0a0']
130-
lab: ['>=3.0.0,<4.0.0a0']
130+
lab: ['>=3.1.0,<4.0.0a0']
131131
r: ['>=4']
132132
steps:
133133
- uses: actions/checkout@v2
@@ -229,7 +229,7 @@ jobs:
229229
# Node 12 end-of-life: April 2022
230230
nodejs: '>=12,<13.0.0.a0'
231231
r: '<4'
232-
lab: '>=3.0.0,<3.1'
232+
lab: '>=3.1.0,<3.2'
233233
- python: '3.10'
234234
# Node 16 end-of-life: April 2024
235235
nodejs: '>=16,<17.0.0.a0'
@@ -372,10 +372,10 @@ jobs:
372372
include:
373373
- python: '3.7'
374374
dist: 'jupyter*lsp*.tar.gz'
375-
lab: '>=3,<3.1'
375+
lab: '>=3.1,<3.2'
376376
- python: '3.8'
377377
dist: 'jupyter*lsp*.whl'
378-
lab: '>=3,<3.1'
378+
lab: '>=3.1,<3.2'
379379
- python: '3.9'
380380
dist: 'jupyter*lsp*.tar.gz'
381381
lab: '>=3.2,<3.3'
@@ -430,7 +430,7 @@ jobs:
430430
nodejs: ['14']
431431
include:
432432
- python: '3.7'
433-
lab: '>=3,<3.1'
433+
lab: '>=3.1,<3.2'
434434
- python: '3.10'
435435
lab: '>=3.2,<4'
436436
steps:

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
## Changelog
22

3+
### `@krassowski/jupyterlab-lsp 3.10.0` (2022-01-01)
4+
5+
- features:
6+
- enable pre-filtering of completion matches by default ([#735])
7+
- add support for diagnostic tags: Deprecated, Unnecessary ([#736], [#737])
8+
- bug fixes:
9+
- squash warnings and errors in web console ([#732])
10+
- fix signature blur and fix formatting when no arguments are present ([#734])
11+
- fixed with enabling of strict null checks:
12+
- previously changing kernels always led to restarting of LSP connection, even if the kernel language did not change; now the connection will be retained if possible
13+
- `markdownRenderer` is no longer implicitly required
14+
- diagnostics sorting with missing values for `source` and `severity` was improved and missing values will be consistently shown at the end
15+
- diagnostics placeholder was split into `Diagnostics are not available` and `No issues detected, great job!` which will now show up properly
16+
- maintenance:
17+
- enable strict null checks and other strict settings ([#733])
18+
- specify client capabilities in features instead of hard-coding them ([#738])
19+
- bump minimum required JupyterLab version to 3.1 (`>=3.1.0,<4.0.0a0`)
20+
21+
[#732]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/732
22+
[#733]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/733
23+
[#734]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/734
24+
[#735]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/735
25+
[#736]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/736
26+
[#737]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/737
27+
[#738]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/738
28+
29+
### `@krassowski/code-jumpers 1.2.0` (2022-01-01)
30+
31+
- maintenance:
32+
- updates to API with respect to `null`/`undefined` values in course strict null checks activation ([#733])
33+
334
### `@krassowski/jupyterlab-lsp 3.9.3` (2021-12-19)
435

536
- bug fixes:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Development requires, at a minimum:
3535
- `python >=3.7,<3.11.0a0`
3636
- Python 3.7 and 3.10 are fully tested on CI
3737
- Python 3.7 to 3.10 and PyPy 3 are verified to at least install and import
38-
- `jupyterlab >=3.0.0,<4.0.0a0`
38+
- `jupyterlab >=3.1.0,<4.0.0a0`
3939

4040
It is recommended to use a virtual environment (e.g. `virtualenv` or `conda env`)
4141
for development.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ over the underlined code to see a more detailed message
2828

2929
![inspections](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/master/examples/screenshots/inspections.png)
3030

31-
### Jump to Definition
31+
### Jump to Definition and References
3232

33-
Use the context menu entry, or <kbd>Alt</kbd> + :computer_mouse: to jump to definitions (you can change it to <kbd>Ctrl</kbd>/<kbd>⌘</kbd> in settings); use <kbd>Alt</kbd> + <kbd>o</kbd> to jump back
33+
Use the context menu entry, or <kbd>Alt</kbd> + :computer_mouse: to jump to definitions/references (you can change it to <kbd>Ctrl</kbd>/<kbd>⌘</kbd> in settings); use <kbd>Alt</kbd> + <kbd>o</kbd> to jump back.
3434

3535
![jump](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/master/examples/screenshots/jump_to_definition.png)
3636

@@ -90,7 +90,7 @@ Use context menu on rows in the panel to filter out diagnostics or copy their me
9090

9191
You will need to have both of the following installed:
9292

93-
- JupyterLab >=3.0.0,<4.0.0a0
93+
- JupyterLab >=3.1.0,<4.0.0a0
9494
- Python 3.7+
9595

9696
In addition, if you wish to use javascript, html, markdown or any other NodeJS-based language server you will need to have appropriate NodeJS version installed.

atest/04_Interface/DiagnosticsPanel.robot

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ Test Teardown Clean Up
88
Force Tags ui:notebook aspect:ls:features
99

1010
*** Variables ***
11-
${EXPECTED_COUNT} 4
12-
${DIAGNOSTIC} W291 trailing whitespace (pycodestyle)
13-
${DIAGNOSTIC MESSAGE} trailing whitespace
1411
${DIAGNOSTIC MESSAGE R} Closing curly-braces should always be on their own line
15-
${R CELL} %%R\n{}
16-
${MENU COLUMNS} xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), "columns")]
12+
${DIAGNOSTIC MESSAGE} trailing whitespace
13+
${DIAGNOSTIC} W291 trailing whitespace (pycodestyle)
14+
${EXPECTED_COUNT} 4
1715
${LAB MENU} css:.lm-Menu
16+
${MENU COLUMNS} xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), "columns")]
17+
${R CELL} %%R\n{}
1818

1919
*** Test Cases ***
2020
Diagnostics Panel Opens
@@ -129,6 +129,7 @@ Open Context Menu Over W291
129129
Table Cell Should Equal W291 row=-1 column=2
130130
Open Context Menu Over css:.lsp-diagnostics-listing tbody > tr:last-child
131131

132+
<<<<<<< HEAD
132133
Expand Menu Entry
133134
[Arguments] ${label}
134135
${entry} = Set Variable xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), "${label}")]
@@ -151,6 +152,8 @@ Select Menu Entry
151152
Click Element ${entry}
152153
Wait Until Page Does Not Contain Element ${entry} timeout=10s
153154

155+
=======
156+
>>>>>>> upsteam/master
154157
Open Notebook And Panel
155158
[Arguments] ${notebook}
156159
Setup Notebook Python ${notebook}

atest/05_Features/Completion.robot

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ ${KERNEL_BUSY_INDICATOR} css:.jp-NotebookPanel-toolbar div[title="Kernel Busy
1414

1515
*** Test Cases ***
1616
Works When Kernel Is Idle
17-
[Documentation] The suggestions from kernel and LSP should get integrated.
18-
Configure JupyterLab Plugin {"kernelResponseTimeout": -1, "waitForBusyKernel": false}
19-
... plugin id=${COMPLETION PLUGIN ID}
17+
[Documentation] The suggestions from kernel and LSP should get integrated; operates in case insensitive mode
18+
Configure JupyterLab Plugin {"kernelResponseTimeout": -1, "waitForBusyKernel": false, "caseSensitive": false} plugin id=${COMPLETION PLUGIN ID}
2019
Enter Cell Editor 1 line=2
2120
Capture Page Screenshot 01-entered-cell.png
2221
Trigger Completer
2322
Capture Page Screenshot 02-completions-shown.png
24-
# lowercase and uppercase suggestions:
2523
Completer Should Suggest TabError
2624
# this comes from LSP:
2725
Completer Should Suggest test
@@ -32,9 +30,19 @@ Works When Kernel Is Idle
3230
${content} = Get Cell Editor Content 1
3331
Should Contain ${content} TabError
3432

33+
Filters Completions In Case Sensitive Mode
34+
Configure JupyterLab Plugin {"caseSensitive": true} plugin id=${COMPLETION PLUGIN ID}
35+
[Documentation] Completions filtering is case-sensitive when caseSensitive is true
36+
Enter Cell Editor 1 line=2
37+
Trigger Completer
38+
Completer Should Suggest test
39+
Completer Should Not Suggest TabError
40+
3541
Can Prioritize Kernel Completions
36-
Configure JupyterLab Plugin {"kernelCompletionsFirst": true, "kernelResponseTimeout": -1}
37-
... plugin id=${COMPLETION PLUGIN ID}
42+
# note: disabling pre-filtering to get ranking without match scoring
43+
Configure JupyterLab Plugin
44+
... {"kernelCompletionsFirst": true, "kernelResponseTimeout": -1, "preFilterMatches": false}
45+
... plugin id=${COMPLETION PLUGIN ID}
3846
Enter Cell Editor 1 line=2
3947
Trigger Completer
4048
Completer Should Suggest %%timeit
@@ -43,8 +51,10 @@ Can Prioritize Kernel Completions
4351
Should Be True ${kernel_position} < ${lsp_position}
4452

4553
Can Prioritize LSP Completions
46-
Configure JupyterLab Plugin {"kernelCompletionsFirst": false, "kernelResponseTimeout": -1}
47-
... plugin id=${COMPLETION PLUGIN ID}
54+
# note: disabling pre-filtering to get ranking without match scoring
55+
Configure JupyterLab Plugin
56+
... {"kernelCompletionsFirst": false, "kernelResponseTimeout": -1, "preFilterMatches": false}
57+
... plugin id=${COMPLETION PLUGIN ID}
4858
Enter Cell Editor 1 line=2
4959
Trigger Completer
5060
Completer Should Suggest %%timeit
@@ -167,6 +177,7 @@ Does Not Autocomplete If Multiple Options
167177
Completer Should Suggest copy
168178

169179
User Can Select Lowercase After Starting Uppercase
180+
Configure JupyterLab Plugin {"caseSensitive": false} plugin id=${COMPLETION PLUGIN ID}
170181
# `from time import Tim<tab>` → `from time import time`
171182
Enter Cell Editor 5 line=1
172183
Trigger Completer
@@ -220,7 +231,7 @@ Triggers Completer On Dot
220231
Completer Should Suggest append
221232

222233
Material Theme Works
223-
Configure JupyterLab Plugin {"theme": "material"} plugin id=${COMPLETION PLUGIN ID}
234+
Configure JupyterLab Plugin {"theme": "material", "caseSensitive": false} plugin id=${COMPLETION PLUGIN ID}
224235
Capture Page Screenshot 01-configured.png
225236
Enter Cell Editor 1 line=2
226237
Trigger Completer
@@ -231,7 +242,7 @@ Material Theme Works
231242
Completer Should Include Icon lsp:material-class-light
232243

233244
VSCode Theme Works
234-
Configure JupyterLab Plugin {"theme": "vscode"} plugin id=${COMPLETION PLUGIN ID}
245+
Configure JupyterLab Plugin {"theme": "vscode", "caseSensitive": false} plugin id=${COMPLETION PLUGIN ID}
235246
Capture Page Screenshot 01-configured.png
236247
Enter Cell Editor 1 line=2
237248
Trigger Completer
@@ -244,7 +255,7 @@ VSCode Dark Theme Works
244255
Lab Command Use Theme: JupyterLab Dark
245256
Wait For Splash
246257
Capture Page Screenshot 00-theme-changed.png
247-
Configure JupyterLab Plugin {"theme": "vscode"} plugin id=${COMPLETION PLUGIN ID}
258+
Configure JupyterLab Plugin {"theme": "vscode", "caseSensitive": false} plugin id=${COMPLETION PLUGIN ID}
248259
Capture Page Screenshot 01-configured.png
249260
Open ${file} in ${MENU NOTEBOOK}
250261
Wait Until Fully Initialized
@@ -257,7 +268,7 @@ VSCode Dark Theme Works
257268
Wait For Splash
258269

259270
Works Without A Theme
260-
Configure JupyterLab Plugin {"theme": null} plugin id=${COMPLETION PLUGIN ID}
271+
Configure JupyterLab Plugin {"theme": null, "caseSensitive": false} plugin id=${COMPLETION PLUGIN ID}
261272
Capture Page Screenshot 01-configured.png
262273
Enter Cell Editor 1 line=2
263274
Trigger Completer
@@ -266,7 +277,7 @@ Works Without A Theme
266277
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-monogram
267278

268279
Works With Incorrect Theme
269-
Configure JupyterLab Plugin {"theme": "a-non-existing-theme"} plugin id=${COMPLETION PLUGIN ID}
280+
Configure JupyterLab Plugin {"theme": "a-non-existing-theme", "caseSensitive": false} plugin id=${COMPLETION PLUGIN ID}
270281
Capture Page Screenshot 01-configured.png
271282
Enter Cell Editor 1 line=2
272283
Trigger Completer

atest/05_Features/Diagnostics.robot

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*** Settings ***
2+
Suite Setup Setup Suite For Screenshots diagnostics
3+
Force Tags feature:diagnostics
4+
Test Setup Setup Notebook Python Diagnostic.ipynb
5+
Test Teardown Clean Up After Working With File Diagnostic.ipynb
6+
Resource ../Keywords.robot
7+
# note: diagnostics are also tested in 01_Editor and 04_Interface/DiagnosticsPanel.robot
8+
9+
*** Test Cases ***
10+
Diagnostics with deprecated tag have strike-through decoration
11+
Wait Until Page Contains Element css:.cm-lsp-diagnostic[title*="is deprecated"] timeout=25s
12+
Wait Until Page Contains Element css:.cm-lsp-diagnostic[title*="Unreachable code"] timeout=5s
13+
Page Should Contain Element css:.cm-lsp-diagnostic-tag-Deprecated
14+
Page Should Contain Element css:.cm-lsp-diagnostic-tag-Unnecessary

atest/05_Features/Jump.robot

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,60 @@ Suite Setup Setup Suite For Screenshots gh-403
66
Force Tags feature:jump-to-definition gh:403
77

88
*** Variables ***
9-
${FOLDER WITH SPACE} a földer
9+
${FOLDER WITH SPACE} a föl@der
1010

1111
*** Test Cases ***
12-
Python Jumps between Files
12+
Python Jumps Between Files
1313
Copy Files to Folder With Spaces jump_a.py jump_b.py
14-
${def} = Set Variable a_function_definition
1514
Open ${FOLDER WITH SPACE}/jump_b.py in ${MENU EDITOR}
1615
Wait Until Fully Initialized
17-
${sel} = Set Variable xpath:(//span[contains(@class, 'cm-variable')][contains(text(), '${def}')])[last()]
16+
${sel} = Select Token Occurrence a_function_definition
1817
Jump To Definition ${sel}
1918
Wait Until Page Contains ANOTHER_CONSTANT
2019
Capture Page Screenshot 10-jumped.png
2120
Clean Up After Working With File jump_b.py
2221

22+
Jumps To References With Modifier Click
23+
[Setup] Prepare File for Editing Python editor jump_references.py
24+
Configure JupyterLab Plugin {"modifierKey": "Accel"} plugin id=${JUMP PLUGIN ID}
25+
Wait Until Fully Initialized
26+
${token} = Select Token Occurrence func type=def
27+
Click Element ${token}
28+
${original} = Measure Cursor Position
29+
Ctrl Click Element ${token}
30+
Wait Until Page Contains Choose the jump target
31+
${references_count} = Get Element Count css:.jp-Dialog select option
32+
Should Be True ${references_count} == ${3}
33+
Select From List By Index css:.jp-Dialog select 2
34+
Click Element css:.jp-Dialog-button.jp-mod-accept
35+
Wait Until Keyword Succeeds 10 x 1 s Cursor Should Jump ${original}
36+
Clean Up After Working With File jump_references.py
37+
38+
Jumps To References From Context Menu
39+
[Setup] Prepare File for Editing Python editor jump_references.py
40+
Wait Until Fully Initialized
41+
${token} = Select Token Occurrence func type=def
42+
Click Element ${token}
43+
${original} = Measure Cursor Position
44+
Open Context Menu Over ${token}
45+
Select Menu Entry Jump to references
46+
Wait Until Page Contains Choose the jump target
47+
${references_count} = Get Element Count css:.jp-Dialog select option
48+
Should Be True ${references_count} == ${3}
49+
Select From List By Index css:.jp-Dialog select 2
50+
Click Element css:.jp-Dialog-button.jp-mod-accept
51+
Wait Until Keyword Succeeds 10 x 1 s Cursor Should Jump ${original}
52+
Clean Up After Working With File jump_references.py
53+
2354
Ctrl Click And Jumping Back Works
2455
[Setup] Prepare File for Editing Python editor jump.py
2556
Configure JupyterLab Plugin {"modifierKey": "Accel"} plugin id=${JUMP PLUGIN ID}
2657
Wait Until Fully Initialized
27-
${usage} = Set Variable a_variable
28-
${sel} = Set Variable xpath:(//span[contains(@class, 'cm-variable')][contains(text(), '${usage}')])[last()]
58+
${sel} = Select Token Occurrence a_variable
2959
Click Element ${sel}
3060
${original} = Measure Cursor Position
3161
Capture Page Screenshot 01-ready-to-jump.png
32-
${key} = Evaluate 'COMMAND' if platform.system() == 'Darwin' else 'CTRL' platform
33-
Click Element ${sel} modifier=${key}
62+
Ctrl Click Element ${sel}
3463
Capture Page Screenshot 02-jumped.png
3564
Wait Until Keyword Succeeds 10 x 1 s Cursor Should Jump ${original}
3665
${new} = Measure Cursor Position
@@ -49,3 +78,16 @@ Copy Files to Folder With Spaces
4978
FOR ${file} IN @{files}
5079
Copy File examples${/}${file} ${NOTEBOOK DIR}${/}${FOLDER WITH SPACE}${/}${file}
5180
END
81+
82+
Select Token Occurrence
83+
[Arguments] ${token} ${type}=variable ${which}=last
84+
[Return] xpath:(//span[contains(@class, 'cm-${type}')][contains(text(), '${token}')])[${which}()]
85+
86+
Ctrl Click Element
87+
[Arguments] ${element}
88+
${key} = Evaluate 'COMMAND' if platform.system() == 'Darwin' else 'CTRL' platform
89+
Click Element ${element} modifier=${key}
90+
91+
Should Have Expected Count
92+
[Arguments] ${expected_count}
93+
${count} = Count Diagnostics In Panel

0 commit comments

Comments
 (0)