Skip to content

Commit 494bec5

Browse files
authored
Fix completer heuristics, fix CI (#1117)
* Fix completer heuristics * Dedupe lockfile * Lint * Adopt to new robocop version * It's all robocop now * Remove deprecated `robotframework-tidy`, update config, fix style * Fix Python versions in smoke, do not run 3.9 on Mac * Lint * Try disabling windowing for tests * Update expectation for lintr
1 parent 4628ce6 commit 494bec5

File tree

11 files changed

+43
-42
lines changed

11 files changed

+43
-42
lines changed

.github/workflows/job.test.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ jobs:
215215
nodejs: '>=18,<19.0.0.a0'
216216
r: '>=4'
217217
lab: '>=4.1.0,<5'
218-
- python: '3.11'
218+
- python: '3.12'
219219
# Node 20 end-of-life: 2026-04-30
220220
nodejs: '>=20,<21.0.0.a0'
221221
r: '>=4'
@@ -345,7 +345,7 @@ jobs:
345345
- python: '3.9'
346346
dist: 'jupyter*lsp*.tar.gz'
347347
lab: '>=4.1.0,<5'
348-
- python: '3.11'
348+
- python: '3.12'
349349
dist: 'jupyter*lsp*.whl'
350350
lab: '>=4.1.0,<5'
351351
- python: 'pypy-3.9'
@@ -357,6 +357,13 @@ jobs:
357357
py_cmd: python3
358358
- os: 'ubuntu'
359359
py_cmd: python
360+
exclude:
361+
# Exclude macOS with Python versions older than 3.11 as setup-python does not support it
362+
# see https://github.com/actions/setup-python/issues/906
363+
- os: macos
364+
python: '3.9'
365+
- os: macos
366+
python: 'pypy-3.9'
360367
steps:
361368
- name: Install Python
362369
uses: actions/setup-python@v5

atest/_fixtures/overrides.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@
1111
}
1212
}
1313
}
14+
},
15+
"@jupyterlab/notebook-extension:tracker": {
16+
"windowingMode": "none"
1417
}
1518
}

atest/_resources/Keywords.resource

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
*** Settings ***
2+
Library Collections
23
Library OperatingSystem
34
Library Process
45
Library String
5-
Library Collections
66
Library SeleniumLibrary
77
Library ../_libraries/logcheck.py
88
Library ../_libraries/ports.py
@@ -37,12 +37,12 @@ Setup Server and Browser
3737
... env:JUPYTER_NO_CONFIG=${EMPTY}
3838
Set Global Variable ${SERVER} ${server}
3939
IF ${wait_for_lsp_log}
40-
Wait Until File Contains ${LAB LOG}
41-
... The following Language Servers will be available
40+
Wait Until File Contains ${LAB LOG}
41+
... The following Language Servers will be available
4242
ELSE
4343
# Jupyter Server X.X.X is running at:
44-
Wait Until File Contains ${LAB LOG}
45-
... is running at:
44+
Wait Until File Contains ${LAB LOG}
45+
... is running at:
4646
END
4747
Open JupyterLab
4848
Read Page Config
@@ -343,8 +343,8 @@ Enter Cell Editor
343343
Click Element css:.jp-Cell:nth-child(${cell_nr}) .cm-line:nth-child(${line})
344344
# So it should be focused after click right? Well, not when using this driver
345345
# in JupyterLab 4.1 - we still need to press enter apparently.
346-
${focused} Get Element Count css:.jp-Cell:nth-child(${cell_nr}) .cm-focused
347-
Run Keyword If ${focused} == 0 Press Keys None ENTER
346+
${focused} = Get Element Count css:.jp-Cell:nth-child(${cell_nr}) .cm-focused
347+
IF ${focused} == 0 Press Keys None ENTER
348348
Wait Until Page Contains Element css:.jp-Cell:nth-child(${cell_nr}) .cm-focused
349349
# clicking on line does not appear sufficient in CM6 (but still useful because it ensures we have it in view
350350
Execute JavaScript

atest/suites/03_Notebook.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Foreign Extractors
5656
@{diagnostics} = Create List
5757
... Double quote to prevent globbing and word splitting # bash, configured by spec.env
5858
... ame 'valid' # python, mypy and pyflakes will fight over `(N|n)ame 'valid'`, just hope for the best
59-
... Trailing whitespace is superfluous. # r
59+
... Remove trailing whitespace. # r
6060
... `frob` is misspelt # markdown
6161
... Command terminated with space # latex
6262
FOR ${diagnostic} IN @{diagnostics}

atest/suites/07_Configuration.robot

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ LaTeX
7373

7474
*** Keywords ***
7575
Settings Should Change Editor Diagnostics
76-
[Arguments]
77-
... ${language}
76+
[Arguments] ${language}
7877
... ${file}
7978
... ${server}
8079
... ${settings}

binder/environment.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ dependencies:
3939
- robotframework >=7
4040
- robotframework-lsp
4141
- robotframework-robocop
42-
- robotframework-tidy
4342
# TODO: handle upstream
4443
# - robotkernel
4544
# - jupyterlab_robotmode
@@ -57,4 +56,3 @@ dependencies:
5756
- mypy
5857
- pip
5958
- robotframework-robocop
60-
- robotframework-tidy

packages/jupyterlab-lsp/src/features/completion/provider.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,23 +161,33 @@ export class CompletionProvider implements ICompletionProvider<CompletionItem> {
161161
return false;
162162
}
163163

164+
// do not show completer on deletions
164165
if (sourceChange.some(delta => delta.delete != null)) {
165166
return false;
166167
}
167168
const token = editor.getTokenAtCursor();
168169

169170
if (this.options.settings.composite.continuousHinting) {
170-
// if token type is known and not ignored token type is ignored - show completer
171+
// show completer if:
172+
// - token type is known, and
173+
// - is not an ignored token type, and
174+
// - the source change includes a non-whitespace insertion
171175
if (
172176
token.type &&
173177
!this.options.settings.composite.suppressContinuousHintingIn.includes(
174178
token.type
179+
) &&
180+
sourceChange.some(
181+
delta =>
182+
delta.insert != null &&
183+
!completerIsVisible &&
184+
delta.insert.trim().length > 0
175185
)
176186
) {
177187
return true;
178188
}
179-
// otherwise show it may still be shown due to trigger character
180189
}
190+
// completer may still be shown due to trigger character
181191
if (
182192
!token.type ||
183193
this.options.settings.composite.suppressTriggerCharacterIn.includes(
@@ -187,11 +197,9 @@ export class CompletionProvider implements ICompletionProvider<CompletionItem> {
187197
return false;
188198
}
189199

200+
// show completer if the trigger character was inserted
190201
return sourceChange.some(
191-
delta =>
192-
delta.insert != null &&
193-
(triggerCharacters.includes(delta.insert) ||
194-
(!completerIsVisible && delta.insert.trim().length > 0))
202+
delta => delta.insert != null && triggerCharacters.includes(delta.insert)
195203
);
196204
}
197205

requirements/github-actions.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ dependencies:
2020
- robotframework >=7
2121
- robotframework-lsp
2222
- robotframework-robocop
23-
- robotframework-tidy
2423
# TODO: handle upstream
2524
# - robotkernel
2625
# - jupyterlab_robotmode

requirements/lint.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ dependencies:
1010
- mypy
1111
- pip
1212
- robotframework-robocop
13-
- robotframework-tidy

scripts/lint.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
"missing-doc-suite",
5858
"missing-doc-test-case",
5959
"missing-doc-resource-file",
60+
"no-global-variable",
61+
"no-suite-variable",
6062
"replace-create-with-var",
6163
"replace-set-variable-with-var",
6264
"todo-in-comment",
@@ -69,11 +71,11 @@
6971
"wrong-case-in-keyword-name",
7072
]
7173

72-
ROBOCOP_CONFIGS = ["line-too-long:line_length:200"]
74+
ROBOCOP_CONFIGS = ["line-too-long.line_length=200"]
7375

7476
ROBOCOP = sum(
7577
[
76-
*[["--exclude", e] for e in ROBOCOP_EXCLUDES],
78+
*[["--ignore", e] for e in ROBOCOP_EXCLUDES],
7779
*[["--configure", c] for c in ROBOCOP_CONFIGS],
7880
],
7981
[],
@@ -119,8 +121,8 @@ def lint(*args):
119121
"--console",
120122
"dotted",
121123
],
122-
robot_tidy=["robotidy", *ALL_ROBOT],
123-
robot_cop=["robocop", *ROBOCOP, *ALL_ROBOT],
124+
robot_tidy=["robocop", "format", *ALL_ROBOT],
125+
robot_cop=["robocop", "check", *ROBOCOP, *ALL_ROBOT],
124126
)
125127

126128
if filters:

yarn.lock

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16799,7 +16799,7 @@ __metadata:
1679916799
languageName: node
1680016800
linkType: hard
1680116801

16802-
"vscode-jsonrpc@npm:8.0.2":
16802+
"vscode-jsonrpc@npm:8.0.2, vscode-jsonrpc@npm:^8.0.2":
1680316803
version: 8.0.2
1680416804
resolution: "vscode-jsonrpc@npm:8.0.2"
1680516805
checksum: 9d055fd4c87ef1093b0eecb5370bfaf3402179b6639149b6d0f7e0bde60cf580091c7e07b0caff868f10f90331b17e7383c087217c077fdd1b5ae7bc23b72f77
@@ -16820,13 +16820,6 @@ __metadata:
1682016820
languageName: node
1682116821
linkType: hard
1682216822

16823-
"vscode-jsonrpc@npm:^8.0.2":
16824-
version: 8.2.0
16825-
resolution: "vscode-jsonrpc@npm:8.2.0"
16826-
checksum: f302a01e59272adc1ae6494581fa31c15499f9278df76366e3b97b2236c7c53ebfc71efbace9041cfd2caa7f91675b9e56f2407871a1b3c7f760a2e2ee61484a
16827-
languageName: node
16828-
linkType: hard
16829-
1683016823
"vscode-languageclient@npm:^6.1.3":
1683116824
version: 6.1.4
1683216825
resolution: "vscode-languageclient@npm:6.1.4"
@@ -16956,7 +16949,7 @@ __metadata:
1695616949
languageName: node
1695716950
linkType: hard
1695816951

16959-
"vscode-languageserver-types@npm:3.17.2":
16952+
"vscode-languageserver-types@npm:3.17.2, vscode-languageserver-types@npm:^3.13.0, vscode-languageserver-types@npm:^3.16.0, vscode-languageserver-types@npm:^3.17.0-next.3, vscode-languageserver-types@npm:^3.7.2":
1696016953
version: 3.17.2
1696116954
resolution: "vscode-languageserver-types@npm:3.17.2"
1696216955
checksum: ef2d862d22f622b64de0f428773d50a5928ec6cdd485960a7564ebe4fd4a3c8bcd956f29eb15bc45a0f353846e62f39f6c764d2ab85ce774b8724411ba84342f
@@ -16970,13 +16963,6 @@ __metadata:
1697016963
languageName: node
1697116964
linkType: hard
1697216965

16973-
"vscode-languageserver-types@npm:^3.13.0, vscode-languageserver-types@npm:^3.16.0, vscode-languageserver-types@npm:^3.17.0-next.3, vscode-languageserver-types@npm:^3.7.2":
16974-
version: 3.17.5
16975-
resolution: "vscode-languageserver-types@npm:3.17.5"
16976-
checksum: 79b420e7576398d396579ca3a461c9ed70e78db4403cd28bbdf4d3ed2b66a2b4114031172e51fad49f0baa60a2180132d7cb2ea35aa3157d7af3c325528210ac
16977-
languageName: node
16978-
linkType: hard
16979-
1698016966
"vscode-languageserver@npm:8.0.0-next.8":
1698116967
version: 8.0.0-next.8
1698216968
resolution: "vscode-languageserver@npm:8.0.0-next.8"

0 commit comments

Comments
 (0)