Skip to content

Commit 729d7b9

Browse files
authored
Merge pull request #724 from bollwyvl/gh-332-add-rflsp-again
Add Robot Framework language server (again)
2 parents 84121b4 + c8c39a2 commit 729d7b9

35 files changed

+542
-331
lines changed

.github/workflows/job.test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ env:
2626
PIP_DISABLE_PIP_VERSION_CHECK: 1
2727
PYTHONUNBUFFERED: 1
2828

29+
ATEST_PROCESSES: 2
2930
ATEST_RETRIES: 3
3031
JLPM_CMD: jlpm --ignore-optional --prefer-offline --frozen-lockfile
3132

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ node_modules
110110
*.tgz
111111

112112
atest/output/
113+
.pabotsuitenames
113114
junit.xml
114115
coverage/
115116
.vscode/

atest/00_Smoke.robot

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*** Settings ***
2-
Suite Setup Set Screenshot Directory ${SCREENSHOTS DIR}${/}smoke
3-
Resource Keywords.robot
2+
Resource Keywords.resource
3+
4+
Suite Setup Set Screenshot Directory ${SCREENSHOTS DIR}${/}smoke
45

56
*** Test Cases ***
67
Lab Version

atest/01_Editor.robot

Lines changed: 54 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
*** Settings ***
2-
Suite Setup Setup Suite For Screenshots editor
3-
Force Tags ui:editor aspect:ls:features
4-
Resource Keywords.robot
5-
Resource Variables.robot
2+
Resource Keywords.resource
3+
Resource Variables.resource
4+
5+
Suite Setup Setup Suite For Screenshots editor
6+
7+
Force Tags ui:editor aspect:ls:features
68

79
*** Test Cases ***
810
Bash
9-
Editor Shows Features for Language Bash example.sh Diagnostics=Failed to parse expression Jump to Definition=fib
11+
Editor Shows Features for Language Bash example.sh Diagnostics=Failed to parse expression
12+
... Jump to Definition=fib
1013

1114
CSS
12-
${def} = Set Variable xpath:(//span[contains(@class, 'cm-variable-2')][contains(text(), '--some-var')])[last()]
13-
Editor Shows Features for Language CSS example.css Diagnostics=Do not use empty rulesets Jump to Definition=${def} Rename=${def}
15+
${def} = Set Variable
16+
... xpath:(//span[contains(@class, 'cm-variable-2')][contains(text(), '--some-var')])[last()]
17+
Editor Shows Features for Language CSS example.css Diagnostics=Do not use empty rulesets
18+
... Jump to Definition=${def} Rename=${def}
1419

1520
Docker
1621
${def} = Set Variable xpath://span[contains(@class, 'cm-string')][contains(text(), 'PLANET')]
17-
Wait Until Keyword Succeeds 3x 100ms Editor Shows Features for Language Docker Dockerfile Diagnostics=Instructions should be written in uppercase letters
18-
... Jump to Definition=${def} Rename=${def}
22+
Wait Until Keyword Succeeds 3x 100ms Editor Shows Features for Language Docker Dockerfile
23+
... Diagnostics=Instructions should be written in uppercase letters Jump to Definition=${def}
24+
... Rename=${def}
1925

2026
JS
2127
${def} = Set Variable xpath:(//span[contains(@class, 'cm-variable')][contains(text(), 'fib')])[last()]
22-
Editor Shows Features for Language JS example.js Diagnostics=Expression expected Jump to Definition=${def} Rename=${def}
28+
Editor Shows Features for Language JS example.js Diagnostics=Expression expected
29+
... Jump to Definition=${def} Rename=${def}
2330

2431
JSON
2532
Editor Shows Features for Language JSON example.json Diagnostics=Duplicate object key
2633

2734
JSX
2835
${def} = Set Variable xpath:(//span[contains(@class, 'cm-variable')][contains(text(), 'hello')])[last()]
29-
Editor Shows Features for Language JSX example.jsx Diagnostics=Expression expected Jump to Definition=${def} Rename=${def}
30-
#Julia
36+
Editor Shows Features for Language JSX example.jsx Diagnostics=Expression expected
37+
... Jump to Definition=${def} Rename=${def}
38+
# Julia
3139
# ${def} = Set Variable xpath:(//span[contains(@class, 'cm-builtin')][contains(text(), 'add_together')])[last()]
3240
# Editor Shows Features for Language Julia example.jl Jump to Definition=${def} Rename=${def}
3341

@@ -38,34 +46,48 @@ LaTeX
3846

3947
Less
4048
${def} = Set Variable xpath:(//span[contains(@class, 'cm-variable-2')][contains(text(), '@width')])[last()]
41-
Editor Shows Features for Language Less example.less Diagnostics=Do not use empty rulesets Jump to Definition=${def}
49+
Editor Shows Features for Language Less example.less Diagnostics=Do not use empty rulesets
50+
... Jump to Definition=${def}
4251

4352
Markdown
4453
Editor Shows Features for Language Markdown example.md Diagnostics=`Color` is misspelt
4554

4655
Python (pylsp)
4756
${def} = Set Variable xpath:(//span[contains(@class, 'cm-variable')][contains(text(), 'fib')])[last()]
48-
Editor Shows Features for Server pylsp Python example.py Diagnostics=undefined name 'result' (pyflakes) Jump to Definition=${def} Rename=${def}
57+
Editor Shows Features for Server pylsp Python example.py Diagnostics=undefined name 'result' (pyflakes)
58+
... Jump to Definition=${def} Rename=${def}
4959

5060
Python (pyright)
5161
${def} = Set Variable xpath:(//span[contains(@class, 'cm-variable')][contains(text(), 'fib')])[last()]
52-
Editor Shows Features for Server pyright Python example.py Diagnostics=is not defined (Pyright) Jump to Definition=${def}
62+
Editor Shows Features for Server pyright Python example.py Diagnostics=is not defined (Pyright)
63+
... Jump to Definition=${def}
5364

5465
R
5566
${def} = Set Variable xpath:(//span[contains(@class, 'cm-variable')][contains(text(), 'fib')])[last()]
56-
Editor Shows Features for Language R example.R Diagnostics=Put spaces around all infix operators Jump to Definition=${def}
67+
Editor Shows Features for Language R example.R Diagnostics=Put spaces around all infix operators
68+
... Jump to Definition=${def}
69+
70+
Robot Framework
71+
[Tags] gh:332
72+
${def} = Set Variable xpath:(//span[contains(@class, 'cm-keyword')][contains(text(), 'Special Log')])[last()]
73+
Editor Shows Features for Language Robot Framework example.robot Diagnostics=Undefined keyword
74+
... Jump to Definition=${def}
5775

5876
SCSS
59-
${def} = Set Variable xpath:(//span[contains(@class, 'cm-variable-2')][contains(text(), 'primary-color')])[last()]
60-
Editor Shows Features for Language SCSS example.scss Diagnostics=Do not use empty rulesets Jump to Definition=${def}
77+
${def} = Set Variable
78+
... xpath:(//span[contains(@class, 'cm-variable-2')][contains(text(), 'primary-color')])[last()]
79+
Editor Shows Features for Language SCSS example.scss Diagnostics=Do not use empty rulesets
80+
... Jump to Definition=${def}
6181

6282
TSX
6383
${def} = Set Variable xpath:(//span[contains(@class, 'cm-tag')][contains(text(), 'HelloWorld')])[last()]
64-
Editor Shows Features for Language TSX example.tsx Diagnostics='hello' is declared but its value is never read. Jump to Definition=${def} Rename=${def}
84+
Editor Shows Features for Language TSX example.tsx
85+
... Diagnostics='hello' is declared but its value is never read. Jump to Definition=${def} Rename=${def}
6586

6687
TypeScript
6788
${def} = Set Variable xpath:(//span[contains(@class, 'cm-variable')][contains(text(), 'inc')])[last()]
68-
Editor Shows Features for Language TypeScript example.ts Diagnostics=The left-hand side of an arithmetic Jump to Definition=${def} Rename=${def}
89+
Editor Shows Features for Language TypeScript example.ts Diagnostics=The left-hand side of an arithmetic
90+
... Jump to Definition=${def} Rename=${def}
6991

7092
SQL
7193
Editor Shows Features for Language SQL example.sql Diagnostics=Expected
@@ -90,9 +112,13 @@ Editor Shows Features for Language
90112
Wait Until Fully Initialized
91113
# Run Keyword If "${Language}" == "Julia" Sleep 5s
92114
FOR ${f} IN @{features}
93-
Run Keyword If "${f}" == "Diagnostics" Editor Should Show Diagnostics ${features["${f}"]}
94-
... ELSE IF "${f}" == "Jump to Definition" Editor Should Jump To Definition ${features["${f}"]}
95-
... ELSE IF "${f}" == "Rename" Editor Should Rename ${features["${f}"]}
115+
IF "${f}" == "Diagnostics"
116+
Editor Should Show Diagnostics ${features["${f}"]}
117+
ELSE IF "${f}" == "Jump to Definition"
118+
Editor Should Jump To Definition ${features["${f}"]}
119+
ELSE IF "${f}" == "Rename"
120+
Editor Should Rename ${features["${f}"]}
121+
END
96122
END
97123
Capture Page Screenshot 99-done.png
98124
[Teardown] Clean Up After Working With File ${file}
@@ -110,16 +136,17 @@ Editor Should Show Diagnostics
110136

111137
Editor Content Changed
112138
[Arguments] ${old_content}
113-
${new_content} Get Editor Content
139+
${new_content} = Get Editor Content
114140
Should Not Be Equal ${old_content} ${new_content}
115141
[Return] ${new_content}
116142

117143
Editor Should Rename
118144
[Arguments] ${symbol}
119145
Set Tags feature:rename
120-
${sel} = Set Variable If "${symbol}".startswith(("xpath", "css")) ${symbol} xpath:(//span[@role="presentation"][contains(., "${symbol}")])[last()]
146+
${sel} = Set Variable If "${symbol}".startswith(("xpath", "css")) ${symbol}
147+
... xpath:(//span[@role="presentation"][contains(., "${symbol}")])[last()]
121148
Open Context Menu Over ${sel}
122-
${old_content} Get Editor Content
149+
${old_content} = Get Editor Content
123150
Capture Page Screenshot 03-rename-0.png
124151
Mouse Over ${MENU RENAME}
125152
Capture Page Screenshot 03-rename-1.png
@@ -128,5 +155,5 @@ Editor Should Rename
128155
Input Into Dialog new_name
129156
Sleep 2s
130157
Capture Page Screenshot 03-rename-3.png
131-
${new_content} Wait Until Keyword Succeeds 10 x 0.1 s Editor Content Changed ${old_content}
158+
${new_content} = Wait Until Keyword Succeeds 10 x 0.1 s Editor Content Changed ${old_content}
132159
Should Be True "new_name" in """${new_content}"""

atest/02_Settings.robot

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*** Settings ***
2-
Suite Setup Setup Suite For Screenshots settings
3-
Resource Keywords.robot
2+
Resource Keywords.resource
3+
4+
Suite Setup Setup Suite For Screenshots settings
45

56
*** Test Cases ***
67
Settings

atest/03_Notebook.robot

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
*** Settings ***
2-
Suite Setup Setup Suite For Screenshots notebook
3-
Test Setup Try to Close All Tabs
4-
Resource Keywords.robot
2+
Resource Keywords.resource
3+
4+
Suite Setup Setup Suite For Screenshots notebook
5+
Test Setup Try to Close All Tabs
56

67
*** Test Cases ***
78
Python
@@ -70,7 +71,8 @@ Code Overrides
7071
Wait Until Created ${virtual_path}
7172
Wait Until Keyword Succeeds 10x 1s File Should Not Be Empty ${virtual_path}
7273
${document} = Get File ${virtual_path}
73-
Should Be Equal ${document} get_ipython().run_line_magic("ls", "")\n\n\nget_ipython().run_line_magic("pip", " freeze")\n
74+
Should Be Equal ${document}
75+
... get_ipython().run_line_magic("ls", "")\n\n\nget_ipython().run_line_magic("pip", " freeze")\n
7476
[Teardown] Clean Up After Working With File Code overrides.ipynb
7577

7678
Adding Text To Cells Is Reflected In Virtual Document

atest/04_Interface/BackendFailure.robot

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
*** Settings ***
2-
Suite Setup Setup Server and Browser server_extension_enabled=${False}
3-
Suite Teardown Setup Server and Browser server_extension_enabled=${True}
4-
Resource ../Keywords.robot
2+
Resource ../Keywords.resource
3+
4+
Suite Setup Setup Server and Browser server_extension_enabled=${False}
5+
Suite Teardown Setup Server and Browser server_extension_enabled=${True}
56

67
*** Variables ***
7-
${STATUSBAR} css:div.lsp-statusbar-item
8-
${POPOVER} css:.lsp-popover
8+
${STATUSBAR} css:div.lsp-statusbar-item
9+
${POPOVER} css:.lsp-popover
910

1011
*** Test Cases ***
1112
Handles Server Extension Failure

atest/04_Interface/DiagnosticsPanel.robot

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
*** Settings ***
2-
Suite Setup Setup Suite For Screenshots diagnostics_panel
3-
Resource ../Keywords.robot
4-
Force Tags ui:notebook aspect:ls:features
5-
Test Setup Set Up
6-
Test Teardown Clean Up
2+
Resource ../Keywords.resource
3+
4+
Suite Setup Setup Suite For Screenshots diagnostics_panel
5+
Test Setup Set Up
6+
Test Teardown Clean Up
7+
8+
Force Tags ui:notebook aspect:ls:features
79

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

1618
*** Test Cases ***
1719
Diagnostics Panel Opens
@@ -45,17 +47,20 @@ Diagnostics Panel Can Be Restored
4547
Wait Until Keyword Succeeds 10 x 1s Should Have Expected Rows Count ${EXPECTED_COUNT}
4648

4749
Columns Can Be Hidden
48-
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL} ${DIAGNOSTIC MESSAGE}
50+
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL}
51+
... ${DIAGNOSTIC MESSAGE}
4952
Open Context Menu Over css:.lsp-diagnostics-listing th
5053
Capture Page Screenshot 01-menu-visible.png
5154
Expand Menu Entry columns
5255
Select Menu Entry Message
5356
Capture Page Screenshot 03-message-column-toggled.png
54-
Wait Until Keyword Succeeds 10 x 1s Element Should Not Contain ${DIAGNOSTICS PANEL} ${DIAGNOSTIC MESSAGE}
57+
Wait Until Keyword Succeeds 10 x 1s Element Should Not Contain ${DIAGNOSTICS PANEL}
58+
... ${DIAGNOSTIC MESSAGE}
5559

5660
Can Sort By Cell
5761
# https://github.com/jupyter-lsp/jupyterlab-lsp/issues/707
58-
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL} ${DIAGNOSTIC MESSAGE}
62+
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL}
63+
... ${DIAGNOSTIC MESSAGE}
5964
Click Element css:.lsp-diagnostics-listing th[data-id="Line:Ch"]
6065
Table Cell Should Equal Line:Ch row=1 column=-1
6166
Table Cell Should Equal 0:0 row=2 column=-1
@@ -68,7 +73,7 @@ Can Sort By Cell
6873
Diagnostics Can Be Ignored By Code
6974
Wait Until Keyword Succeeds 10 x 1s Should Have Expected Rows Count ${EXPECTED_COUNT}
7075
# W291 should be shown twice, lets try to hide it
71-
${EXPECTED_AFTER} Evaluate ${EXPECTED_COUNT}-2
76+
${EXPECTED_AFTER} = Evaluate ${EXPECTED_COUNT}-2
7277
Open Context Menu Over W291
7378
Expand Menu Entry Ignore diagnostics
7479
Select Menu Entry code
@@ -79,7 +84,7 @@ Diagnostics Can Be Ignored By Code
7984
Diagnostics Can Be Ignored By Message
8085
Wait Until Keyword Succeeds 10 x 1s Should Have Expected Rows Count ${EXPECTED_COUNT}
8186
# W291 should be shown twice, lets try to hide it
82-
${EXPECTED_AFTER} Evaluate ${EXPECTED_COUNT}-2
87+
${EXPECTED_AFTER} = Evaluate ${EXPECTED_COUNT}-2
8388
Open Context Menu Over W291
8489
Expand Menu Entry Ignore diagnostics
8590
Capture Page Screenshot 02-menu-visible.png
@@ -89,7 +94,8 @@ Diagnostics Can Be Ignored By Message
8994
Wait Until Keyword Succeeds 10 x 1s Should Have Expected Rows Count ${EXPECTED_AFTER}
9095

9196
Diagnostic Message Can Be Copied
92-
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL} ${DIAGNOSTIC MESSAGE}
97+
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL}
98+
... ${DIAGNOSTIC MESSAGE}
9399
Open Context Menu Over css:.lsp-diagnostics-listing tbody tr
94100
Select Menu Entry Copy diagnostic
95101
Close Diagnostics Panel
@@ -100,16 +106,20 @@ Diagnostics Panel Works After Removing Foreign Document
100106
Lab Command Insert Cell Below
101107
Enter Cell Editor 3
102108
Press Keys None ${R CELL}
103-
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL} ${DIAGNOSTIC MESSAGE}
104-
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL} ${DIAGNOSTIC MESSAGE R}
109+
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL}
110+
... ${DIAGNOSTIC MESSAGE}
111+
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL}
112+
... ${DIAGNOSTIC MESSAGE R}
105113
Lab Command Delete Cells
106114
# regain focus by entering cell
107115
Enter Cell Editor 2
108116
# trigger 7 document updates to trigger the garbage collector that removes unused documents
109117
# (search for VirtualDocument.remainining_lifetime for more)
110118
Press Keys None 1234567
111-
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL} ${DIAGNOSTIC MESSAGE}
112-
Wait Until Keyword Succeeds 10 x 1s Element Should Not Contain ${DIAGNOSTICS PANEL} ${DIAGNOSTIC MESSAGE R}
119+
Wait Until Keyword Succeeds 10 x 1s Element Should Contain ${DIAGNOSTICS PANEL}
120+
... ${DIAGNOSTIC MESSAGE}
121+
Wait Until Keyword Succeeds 10 x 1s Element Should Not Contain ${DIAGNOSTICS PANEL}
122+
... ${DIAGNOSTIC MESSAGE R}
113123

114124
*** Keywords ***
115125
Open Context Menu Over W291

atest/04_Interface/Statusbar.robot

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
*** Settings ***
2-
Suite Setup Setup Suite For Screenshots statusbar
3-
Resource ../Keywords.robot
2+
Resource ../Keywords.resource
3+
4+
Suite Setup Setup Suite For Screenshots statusbar
45

56
*** Variables ***
6-
${STATUSBAR} css:div.lsp-statusbar-item
7-
${DIAGNOSTIC} W291 trailing whitespace (pycodestyle)
8-
${POPOVER} css:.lsp-popover
9-
${HELP_BUTTON} css:.lsp-popover .lsp-help-button
7+
${STATUSBAR} css:div.lsp-statusbar-item
8+
${DIAGNOSTIC} W291 trailing whitespace (pycodestyle)
9+
${POPOVER} css:.lsp-popover
10+
${HELP_BUTTON} css:.lsp-popover .lsp-help-button
1011

1112
*** Test Cases ***
1213
Statusbar Popup Opens
@@ -21,7 +22,9 @@ Statusbar Popup Opens
2122
[Teardown] Clean Up After Working With File Python.ipynb
2223

2324
Troubleshooting And Help Is Offered For Known Non-Installed Servers
24-
[Documentation] When specification of a language server has been configured or provided, but the server is not installed (or detected) the user should get help on installation and/or troubleshooting
25+
[Documentation] When specification of a language server has been configured
26+
... or provided, but the server is not installed (or detected) the user
27+
... should get help on installation and/or troubleshooting
2528
Prepare File for Editing Python status example.klingon
2629
Wait Until Element Contains ${STATUSBAR} Initialized (additional servers needed) timeout=60s
2730
Click Element ${STATUSBAR}

0 commit comments

Comments
 (0)