Skip to content

Commit 3fb68db

Browse files
authored
Merge pull request #978 from krassowski/hover-ci
Prepare extension and CI for release candidate
2 parents 86df891 + 382cad3 commit 3fb68db

Some content is hidden

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

50 files changed

+1316
-694
lines changed

.github/workflows/job.test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
matrix:
4545
os: [ubuntu]
4646
nodejs: ['>=16,<17.0.0a0']
47-
lab: ['>=4.0.5,<5.0.0a0']
47+
lab: ['>=4.0.6,<5.0.0a0']
4848
r: ['>=4']
4949
steps:
5050
- uses: actions/checkout@v3

CHANGELOG.md

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

3+
### `@jupyter-lsp/jupyterlab-lsp 5.0.0-rc.0`
4+
5+
- fixes diagnostics not showing up in text editor in certain circumstances
6+
- fixes signature hover box not being clickable
7+
- improves performance by not creating a temporary editor to setup linter underline style
8+
- JSON overrides work again
9+
- fixes issue with syntax highlighting breaking when pasting multiple cells
10+
11+
Requires JupyterLab `>=4.0.6,<5.0.0a0`
12+
313
### `@jupyter-lsp/jupyterlab-lsp 5.0.0-beta.1`
414

515
- fix highlights conflict with selection

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Development requires, at a minimum:
3333

3434
- `nodejs >=16,!=17,<19`
3535
- `python >=3.8,<3.11.0a0`
36-
- `jupyterlab >=4.0.5,<5.0.0a0`
36+
- `jupyterlab >=4.0.6,<5.0.0a0`
3737

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 >=4.0.5,<5.0.0a0
93+
- JupyterLab >=4.0.6,<5.0.0a0
9494
- Python 3.8+
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/01_Editor.robot

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,56 +9,55 @@ Test Tags ui:editor aspect:ls:features
99

1010
*** Test Cases ***
1111
Bash
12-
${def} = Set Variable xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., 'HelloWorld')])[last()]
12+
${def} = Set Variable lastToken:fib
1313
Editor Shows Features for Language
1414
... Bash
1515
... example.sh
1616
... Diagnostics=Double quote to prevent globbing and word splitting.
1717
... Jump to Definition=${def}
1818

1919
CSS
20-
${def} = Set Variable
21-
... xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., '--some-var')])[last()]
20+
${def} = Set Variable lastToken:--some-var
2221
Editor Shows Features for Language CSS example.css Diagnostics=Do not use empty rulesets
2322
... Jump to Definition=${def} Rename=${def}
2423

2524
Docker
26-
${def} = Set Variable xpath://div[contains(@class, 'cm-line')]//text()[contains(., 'PLANET')]
25+
${def} = Set Variable lastToken:PLANET
2726
Wait Until Keyword Succeeds 3x 100ms Editor Shows Features for Language Docker Dockerfile
2827
... Diagnostics=Instructions should be written in uppercase letters Jump to Definition=${def}
2928
... Rename=${def}
3029

3130
JS
32-
${def} = Set Variable xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., 'fib')])[last()]
31+
${def} = Set Variable lastToken:fib
3332
Editor Shows Features for Language JS example.js Diagnostics=Expression expected
3433
... Jump to Definition=${def} Rename=${def}
3534

3635
JSON
3736
Editor Shows Features for Language JSON example.json Diagnostics=Duplicate object key
3837

3938
JSX
40-
${def} = Set Variable xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., 'hello')])[last()]
39+
${def} = Set Variable lastToken:hello
4140
Editor Shows Features for Language JSX example.jsx Diagnostics=Expression expected
4241
... Jump to Definition=${def} Rename=${def}
4342
# Julia
44-
# ${def} = Set Variable xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., 'add_together')])[last()]
43+
# ${def} = Set Variable lastToken:add_together
4544
# Editor Shows Features for Language Julia example.jl Jump to Definition=${def} Rename=${def}
4645

4746
LaTeX
4847
[Tags] language:latex
49-
${def} = Set Variable xpath:(//div[contains(@class, 'cm-line')]//span[contains(text(), 'foo')])[last()]
48+
${def} = Set Variable lastToken:foo
5049
Editor Shows Features for Language LaTeX example.tex Jump to Definition=${def} Rename=${def}
5150

5251
Less
53-
${def} = Set Variable xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., '@width')])[last()]
52+
${def} = Set Variable lastToken:@width
5453
Editor Shows Features for Language Less example.less Diagnostics=Do not use empty rulesets
5554
... Jump to Definition=${def}
5655

5756
Markdown
5857
Editor Shows Features for Language Markdown example.md Diagnostics=`Color` is misspelt
5958

6059
Python (pylsp)
61-
${def} = Set Variable xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., 'fib')])[last()]
60+
${def} = Set Variable lastToken:fib
6261
Editor Shows Features for Server
6362
... pylsp
6463
... Python
@@ -68,35 +67,33 @@ Python (pylsp)
6867
... Rename=${def}
6968

7069
Python (pyright)
71-
${def} = Set Variable xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., 'fib')])[last()]
70+
${def} = Set Variable lastToken:fib
7271
Editor Shows Features for Server pyright Python example.py Diagnostics=is not defined (Pyright)
7372
... Jump to Definition=${def}
7473

7574
R
76-
${def} = Set Variable xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., 'fib')])[last()]
75+
${def} = Set Variable lastToken:fib
7776
Editor Shows Features for Language R example.R Diagnostics=Put spaces around all infix operators
7877
... Jump to Definition=${def}
7978

8079
Robot Framework
8180
[Tags] gh:332
82-
${def} = Set Variable
83-
... xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., 'Special Log')])[last()]
81+
${def} = Set Variable lastToken:Special Log
8482
Editor Shows Features for Language Robot Framework example.robot Diagnostics=Undefined keyword
8583
... Jump to Definition=${def}
8684

8785
SCSS
88-
${def} = Set Variable
89-
... xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., 'primary-color')])[last()]
86+
${def} = Set Variable lastToken:primary-color
9087
Editor Shows Features for Language SCSS example.scss Diagnostics=Do not use empty rulesets
9188
... Jump to Definition=${def}
9289

9390
TSX
94-
${def} = Set Variable xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., 'HelloWorld')])[last()]
91+
${def} = Set Variable lastToken:HelloWorld
9592
Editor Shows Features for Language TSX example.tsx
9693
... Diagnostics='hello' is declared but its value is never read. Jump to Definition=${def} Rename=${def}
9794

9895
TypeScript
99-
${def} = Set Variable xpath:(//div[contains(@class, 'cm-line')]//text()[contains(., 'inc')])[last()]
96+
${def} = Set Variable lastToken:inc
10097
Editor Shows Features for Language TypeScript example.ts Diagnostics=The left-hand side of an arithmetic
10198
... Jump to Definition=${def} Rename=${def}
10299

@@ -155,9 +152,7 @@ Editor Content Changed
155152
Editor Should Rename
156153
[Arguments] ${symbol}
157154
Set Tags feature:rename
158-
${sel} = Set Variable If "${symbol}".startswith(("xpath", "css")) ${symbol}
159-
... xpath:(//span[@role="presentation"][contains(., "${symbol}")])[last()]
160-
Open Context Menu Over ${sel}
155+
Open Context Menu Over Token ${symbol}
161156
${old_content} = Get Editor Content
162157
Capture Page Screenshot 03-rename-0.png
163158
Mouse Over ${MENU RENAME}

atest/04_Interface/DiagnosticsPanel.robot

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ ${DIAGNOSTIC MESSAGE} trailing whitespace
1414
${DIAGNOSTIC} W291 trailing whitespace (pycodestyle)
1515
${EXPECTED_COUNT} 4
1616
${MENU COLUMNS} xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), "columns")]
17-
${R CELL} %%R\n{}
1817

1918

2019
*** Test Cases ***
@@ -79,9 +78,8 @@ Diagnostics Can Be Ignored By Code
7978
Open Context Menu Over W291
8079
Expand Menu Entry Ignore diagnostics
8180
Select Menu Entry code
82-
Open in Advanced Settings ${DIAGNOSTICS PLUGIN ID}
83-
Capture Page Screenshot 02-code-pressed.png
8481
Wait Until Keyword Succeeds 10 x 1s Should Have Expected Rows Count ${EXPECTED_AFTER}
82+
Configure JupyterLab Plugin {} plugin id=${DIAGNOSTICS PLUGIN ID}
8583

8684
Diagnostics Can Be Ignored By Message
8785
Wait Until Keyword Succeeds 10 x 1s Should Have Expected Rows Count ${EXPECTED_COUNT}
@@ -91,38 +89,48 @@ Diagnostics Can Be Ignored By Message
9189
Expand Menu Entry Ignore diagnostics
9290
Capture Page Screenshot 02-menu-visible.png
9391
Select Menu Entry Ignore diagnostics with "W291 trailing whitespace" message
94-
Open in Advanced Settings ${DIAGNOSTICS PLUGIN ID}
95-
Capture Page Screenshot 02-message-pressed.png
9692
Wait Until Keyword Succeeds 10 x 1s Should Have Expected Rows Count ${EXPECTED_AFTER}
93+
Configure JupyterLab Plugin {} plugin id=${DIAGNOSTICS PLUGIN ID}
9794

9895
Diagnostic Message Can Be Copied
9996
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL}
10097
... ${DIAGNOSTIC MESSAGE}
10198
Open Context Menu Over css:.lsp-diagnostics-listing tbody tr
10299
Select Menu Entry Copy diagnostic
103100
Close Diagnostics Panel
104-
Wait Until Element Contains css:.lsp-statusbar-item Successfully copied timeout=10s
101+
Wait Until Element Contains css:.jp-toast-message Successfully copied timeout=10s
105102

106103
Diagnostics Panel Works After Removing Foreign Document
107104
Enter Cell Editor 2
108105
Lab Command Insert Cell Below
109106
Enter Cell Editor 3
110-
Press Keys None ${R CELL}
107+
Press Keys None %%R\n
108+
# these two steps ideally would not be needed (they show that for slow-starting server
109+
# update may not be triggered until user manually makes another action).
110+
Wait Until Fully Initialized
111+
Press Keys None {}
111112
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL}
112113
... ${DIAGNOSTIC MESSAGE}
113114
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL}
114115
... ${DIAGNOSTIC MESSAGE R}
115-
Lab Command Delete Cells
116+
Lab Command Delete Cell
116117
# regain focus by entering cell
117118
Enter Cell Editor 2
118119
# trigger 7 document updates to trigger the garbage collector that removes unused documents
119-
# (search for VirtualDocument.remainining_lifetime for more)
120+
# (search for VirtualDocument.remainingLifetime for more)
120121
Press Keys None 1234567
121122
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL}
122123
... ${DIAGNOSTIC MESSAGE}
123124
Wait Until Keyword Succeeds 10 x 1s Element Should Not Contain ${DIAGNOSTICS PANEL}
124125
... ${DIAGNOSTIC MESSAGE R}
125-
126+
# it should be possible to get the diagnostic back after re-creatign the cell
127+
Lab Command Insert Cell Below
128+
Enter Cell Editor 3
129+
Press Keys None %%R\n{}
130+
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL}
131+
... ${DIAGNOSTIC MESSAGE}
132+
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL}
133+
... ${DIAGNOSTIC MESSAGE R}
126134

127135
*** Keywords ***
128136
Open Context Menu Over W291
@@ -134,7 +142,7 @@ Open Context Menu Over W291
134142
Open Notebook And Panel
135143
[Arguments] ${notebook}
136144
Setup Notebook Python ${notebook}
137-
Capture Page Screenshot 00-notebook-and-panel-openeing.png
145+
Capture Page Screenshot 00-notebook-and-panel-opening.png
138146
Wait Until Page Contains Diagnostic [title*="${DIAGNOSTIC}"] timeout=20s
139147
Open Diagnostics Panel
140148
Capture Page Screenshot 00-notebook-and-panel-opened.png

atest/05_Features/Completion.robot

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Invalidates On Focus Loss
8585
Completer Should Not Suggest test
8686
Enter Cell Editor 1 line=2
8787

88-
Uses LSP Completions When Kernel Resoponse Times Out
88+
Uses LSP Completions When Kernel Response Times Out
8989
[Tags] requires:busy-indicator
9090
Configure JupyterLab Plugin {"kernelResponseTimeout": 1, "waitForBusyKernel": true}
9191
... plugin id=${COMPLETION PLUGIN ID}
@@ -150,7 +150,7 @@ Continuous Hinting Works
150150
[Setup] Prepare File for Editing Python completion completion.py
151151
Configure JupyterLab Plugin {"continuousHinting": true} plugin id=${COMPLETION PLUGIN ID}
152152
# TODO: remove once we resolve https://github.com/jupyterlab/jupyterlab/issues/15022
153-
Configure JupyterLab Plugin {"autoCompletion": true} plugin id=${MANAGER PLUGIN ID}
153+
Configure JupyterLab Plugin {"autoCompletion": true, "providerTimeout": 2500} plugin id=${MANAGER PLUGIN ID}
154154
Place Cursor In File Editor At 9 2
155155
Wait For Ready State
156156
Press Keys None d
@@ -373,6 +373,8 @@ Completes Paths In Strings
373373
*** Keywords ***
374374
Setup Completion Test
375375
Setup Notebook Python Completion.ipynb
376+
# TODO: this should be per-provider (upstream issue)
377+
Configure JupyterLab Plugin {"providerTimeout": 2500} plugin id=${MANAGER PLUGIN ID}
376378

377379
Get Cell Editor Content
378380
[Arguments] ${cell_nr}
@@ -470,4 +472,4 @@ Should Complete While Kernel Is Busy
470472
Page Should Contain Element ${KERNEL_BUSY_INDICATOR}
471473

472474
Wait For Our Completer To Initialize
473-
Wait Until Page Contains Element css:.body[data-lsp-completer-layout]
475+
Wait Until Page Contains Element css:body[data-lsp-completer-layout]

atest/05_Features/Hover.robot

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ${HOVER_SIGNAL} css:.cm-lsp-hover-available
1717
*** Test Cases ***
1818
Hover Does Not Trigger Automatically
1919
Enter Cell Editor 1
20-
${sel} = Last Occurrence python_add
20+
${sel} = Set Variable lastToken:python_add
2121
Configure JupyterLab Plugin {"autoActivate": false}
2222
... plugin id=${HOVER PLUGIN ID}
2323
Trigger Automatically By Hover ${sel}
@@ -27,7 +27,7 @@ Hover Does Not Trigger Automatically
2727

2828
Hover Triggers Automatically
2929
Enter Cell Editor 1
30-
${sel} = Last Occurrence python_add
30+
${sel} = Set Variable lastToken:python_add
3131
Configure JupyterLab Plugin {"delay": 100, "autoActivate": true}
3232
... plugin id=${HOVER PLUGIN ID}
3333
Trigger Automatically By Hover ${sel}
@@ -48,7 +48,7 @@ Hover works in notebooks
4848

4949
Hover can be triggered via modifier key once cursor stopped moving
5050
Enter Cell Editor 1
51-
${element} = Last Occurrence python_add
51+
${element} = Set Variable lastToken:python_add
5252
Wait Until Keyword Succeeds 5x 0.1 s Trigger Via Modifier Key Press ${element}
5353

5454
Hover works in foreign code (javascript)
@@ -70,60 +70,46 @@ Update hover after character deletion
7070
Enter Cell Editor 4
7171
Trigger Tooltip atan2
7272
Element Text Should Be ${HOVER_SIGNAL} atan2
73-
Capture Page Screenshot 01-hover-before-delection.png
73+
Capture Page Screenshot 01-hover-before-deletion.png
7474
Element Should Contain ${HOVER_BOX} atan2(y: SupportsFloat, x: SupportsFloat, /)
7575
Place Cursor In Cell Editor At 4 line=2 character=13
7676
Press Keys None DELETE
7777
Trigger Tooltip atan
7878
Element Text Should Be ${HOVER_SIGNAL} atan
79-
Capture Page Screenshot 02-hover-after-delection.png
79+
Capture Page Screenshot 02-hover-after-deletion.png
8080
Element Should Contain ${HOVER_BOX} atan(x: SupportsFloat, /)
8181

8282

8383
*** Keywords ***
84-
Last Occurrence
85-
[Arguments] ${symbol}
86-
${sel} = Set Variable If "${symbol}".startswith(("xpath", "css")) ${symbol}
87-
... xpath:(//div[@class="cm-content"]//text()[contains(., "${symbol}")])[last()]
88-
RETURN ${sel}
89-
9084
Trigger Automatically By Hover
9185
[Arguments] ${sel}
9286
# bring the cursor to the element
93-
Wokraround Visibility Problem ${sel}
94-
Mouse Over ${sel}
87+
Mouse Over Token ${sel}
9588
Wait Until Page Contains Element ${HOVER_SIGNAL} timeout=10s
96-
Mouse Over And Wiggle ${sel} 5
89+
Mouse Over Token And Wiggle ${sel} 5
9790

9891
Trigger Via Hover With Modifier
9992
[Arguments] ${sel}
10093
# bring the cursor to the element
101-
Wokraround Visibility Problem ${sel}
102-
Mouse Over ${sel}
103-
# move it back and forth (wiggle) while hodling the ctrl modifier
104-
Mouse Over With Control ${sel} x_wiggle=5
94+
Mouse Over Token ${sel}
95+
# move it back and forth (wiggle) while holding the ctrl modifier
96+
Mouse Over Token With Control ${sel} x_wiggle=5
10597
Wait Until Keyword Succeeds 4x 0.1s Page Should Contain Element ${HOVER_BOX}
10698

10799
Trigger Via Modifier Key Press
108100
[Arguments] ${sel}
109101
# bring the cursor to the element
110-
Wokraround Visibility Problem ${sel}
111-
Mouse Over ${sel}
102+
Mouse Over Token ${sel}
112103
Wait Until Page Contains Element ${HOVER_SIGNAL} timeout=10s
113-
Mouse Over And Wiggle ${sel} 5
114-
Press Keys ${sel} CTRL
104+
Mouse Over Token And Wiggle ${sel} 5
105+
Press Keys None CTRL
115106
Wait Until Keyword Succeeds 4x 0.1s Page Should Contain Element ${HOVER_BOX}
116107

117108
Trigger Tooltip
118109
[Documentation] The default way to trigger the hover tooltip
119110
[Arguments] ${symbol}
120-
${sel} = Last Occurrence ${symbol}
111+
${sel} = Set Variable lastToken:${symbol}
121112
Wait Until Keyword Succeeds 4x 0.1 s Trigger Via Hover With Modifier ${sel}
122113

123114
Setup Hover Test
124115
Setup Notebook Python Hover.ipynb
125-
126-
Wokraround Visibility Problem
127-
[Arguments] ${sel}
128-
${width} ${height} = Get Element Size ${sel}
129-
IF ${width} == 0 Cover Element ${sel}

atest/05_Features/Jump.robot

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ Python Jumps Between Files
1515
Copy Files to Folder With Spaces jump_a.py jump_b.py
1616
Open ${FOLDER WITH SPACE}/jump_b.py in ${MENU EDITOR}
1717
Wait Until Fully Initialized
18-
${sel} = Select Token Occurrence a_function_definition
19-
Jump To Definition ${sel}
18+
Jump To Definition lastToken:a_function_definition
2019
Wait Until Page Contains ANOTHER_CONSTANT
2120
Capture Page Screenshot 10-jumped.png
2221
[Teardown] Clean Up Folder With Spaces jump_a.py jump_b.py

0 commit comments

Comments
 (0)