diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 3b8fc298b..eec46fc4d 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -215,7 +215,7 @@ jobs: nodejs: '>=18,<19.0.0.a0' r: '>=4' lab: '>=4.1.0,<5' - - python: '3.11' + - python: '3.12' # Node 20 end-of-life: 2026-04-30 nodejs: '>=20,<21.0.0.a0' r: '>=4' @@ -345,7 +345,7 @@ jobs: - python: '3.9' dist: 'jupyter*lsp*.tar.gz' lab: '>=4.1.0,<5' - - python: '3.11' + - python: '3.12' dist: 'jupyter*lsp*.whl' lab: '>=4.1.0,<5' - python: 'pypy-3.9' @@ -357,6 +357,13 @@ jobs: py_cmd: python3 - os: 'ubuntu' py_cmd: python + exclude: + # Exclude macOS with Python versions older than 3.11 as setup-python does not support it + # see https://github.com/actions/setup-python/issues/906 + - os: macos + python: '3.9' + - os: macos + python: 'pypy-3.9' steps: - name: Install Python uses: actions/setup-python@v5 diff --git a/atest/_fixtures/overrides.json b/atest/_fixtures/overrides.json index 726fe9625..a1df1c3f5 100644 --- a/atest/_fixtures/overrides.json +++ b/atest/_fixtures/overrides.json @@ -11,5 +11,8 @@ } } } + }, + "@jupyterlab/notebook-extension:tracker": { + "windowingMode": "none" } } diff --git a/atest/_resources/Keywords.resource b/atest/_resources/Keywords.resource index a74b05723..fc7cf639d 100644 --- a/atest/_resources/Keywords.resource +++ b/atest/_resources/Keywords.resource @@ -1,8 +1,8 @@ *** Settings *** +Library Collections Library OperatingSystem Library Process Library String -Library Collections Library SeleniumLibrary Library ../_libraries/logcheck.py Library ../_libraries/ports.py @@ -37,12 +37,12 @@ Setup Server and Browser ... env:JUPYTER_NO_CONFIG=${EMPTY} Set Global Variable ${SERVER} ${server} IF ${wait_for_lsp_log} - Wait Until File Contains ${LAB LOG} - ... The following Language Servers will be available + Wait Until File Contains ${LAB LOG} + ... The following Language Servers will be available ELSE # Jupyter Server X.X.X is running at: - Wait Until File Contains ${LAB LOG} - ... is running at: + Wait Until File Contains ${LAB LOG} + ... is running at: END Open JupyterLab Read Page Config @@ -343,8 +343,8 @@ Enter Cell Editor Click Element css:.jp-Cell:nth-child(${cell_nr}) .cm-line:nth-child(${line}) # So it should be focused after click right? Well, not when using this driver # in JupyterLab 4.1 - we still need to press enter apparently. - ${focused} Get Element Count css:.jp-Cell:nth-child(${cell_nr}) .cm-focused - Run Keyword If ${focused} == 0 Press Keys None ENTER + ${focused} = Get Element Count css:.jp-Cell:nth-child(${cell_nr}) .cm-focused + IF ${focused} == 0 Press Keys None ENTER Wait Until Page Contains Element css:.jp-Cell:nth-child(${cell_nr}) .cm-focused # clicking on line does not appear sufficient in CM6 (but still useful because it ensures we have it in view Execute JavaScript diff --git a/atest/suites/03_Notebook.robot b/atest/suites/03_Notebook.robot index 345e97a8c..b866cc0e7 100644 --- a/atest/suites/03_Notebook.robot +++ b/atest/suites/03_Notebook.robot @@ -56,7 +56,7 @@ Foreign Extractors @{diagnostics} = Create List ... Double quote to prevent globbing and word splitting # bash, configured by spec.env ... ame 'valid' # python, mypy and pyflakes will fight over `(N|n)ame 'valid'`, just hope for the best - ... Trailing whitespace is superfluous. # r + ... Remove trailing whitespace. # r ... `frob` is misspelt # markdown ... Command terminated with space # latex FOR ${diagnostic} IN @{diagnostics} diff --git a/atest/suites/07_Configuration.robot b/atest/suites/07_Configuration.robot index 07964f32c..3a55b0e95 100644 --- a/atest/suites/07_Configuration.robot +++ b/atest/suites/07_Configuration.robot @@ -73,8 +73,7 @@ LaTeX *** Keywords *** Settings Should Change Editor Diagnostics - [Arguments] - ... ${language} + [Arguments] ${language} ... ${file} ... ${server} ... ${settings} diff --git a/binder/environment.yml b/binder/environment.yml index 3967610a8..883a1362d 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -39,7 +39,6 @@ dependencies: - robotframework >=7 - robotframework-lsp - robotframework-robocop - - robotframework-tidy # TODO: handle upstream # - robotkernel # - jupyterlab_robotmode @@ -57,4 +56,3 @@ dependencies: - mypy - pip - robotframework-robocop - - robotframework-tidy diff --git a/packages/jupyterlab-lsp/src/features/completion/provider.ts b/packages/jupyterlab-lsp/src/features/completion/provider.ts index 07b2be605..8dc29c782 100644 --- a/packages/jupyterlab-lsp/src/features/completion/provider.ts +++ b/packages/jupyterlab-lsp/src/features/completion/provider.ts @@ -161,23 +161,33 @@ export class CompletionProvider implements ICompletionProvider { return false; } + // do not show completer on deletions if (sourceChange.some(delta => delta.delete != null)) { return false; } const token = editor.getTokenAtCursor(); if (this.options.settings.composite.continuousHinting) { - // if token type is known and not ignored token type is ignored - show completer + // show completer if: + // - token type is known, and + // - is not an ignored token type, and + // - the source change includes a non-whitespace insertion if ( token.type && !this.options.settings.composite.suppressContinuousHintingIn.includes( token.type + ) && + sourceChange.some( + delta => + delta.insert != null && + !completerIsVisible && + delta.insert.trim().length > 0 ) ) { return true; } - // otherwise show it may still be shown due to trigger character } + // completer may still be shown due to trigger character if ( !token.type || this.options.settings.composite.suppressTriggerCharacterIn.includes( @@ -187,11 +197,9 @@ export class CompletionProvider implements ICompletionProvider { return false; } + // show completer if the trigger character was inserted return sourceChange.some( - delta => - delta.insert != null && - (triggerCharacters.includes(delta.insert) || - (!completerIsVisible && delta.insert.trim().length > 0)) + delta => delta.insert != null && triggerCharacters.includes(delta.insert) ); } diff --git a/requirements/github-actions.yml b/requirements/github-actions.yml index f7fc01a3d..a526da905 100644 --- a/requirements/github-actions.yml +++ b/requirements/github-actions.yml @@ -20,7 +20,6 @@ dependencies: - robotframework >=7 - robotframework-lsp - robotframework-robocop - - robotframework-tidy # TODO: handle upstream # - robotkernel # - jupyterlab_robotmode diff --git a/requirements/lint.yml b/requirements/lint.yml index 2b4775b96..6c35118cb 100644 --- a/requirements/lint.yml +++ b/requirements/lint.yml @@ -10,4 +10,3 @@ dependencies: - mypy - pip - robotframework-robocop - - robotframework-tidy diff --git a/scripts/lint.py b/scripts/lint.py index e0a0aa379..c707dbf9b 100644 --- a/scripts/lint.py +++ b/scripts/lint.py @@ -57,6 +57,8 @@ "missing-doc-suite", "missing-doc-test-case", "missing-doc-resource-file", + "no-global-variable", + "no-suite-variable", "replace-create-with-var", "replace-set-variable-with-var", "todo-in-comment", @@ -69,11 +71,11 @@ "wrong-case-in-keyword-name", ] -ROBOCOP_CONFIGS = ["line-too-long:line_length:200"] +ROBOCOP_CONFIGS = ["line-too-long.line_length=200"] ROBOCOP = sum( [ - *[["--exclude", e] for e in ROBOCOP_EXCLUDES], + *[["--ignore", e] for e in ROBOCOP_EXCLUDES], *[["--configure", c] for c in ROBOCOP_CONFIGS], ], [], @@ -119,8 +121,8 @@ def lint(*args): "--console", "dotted", ], - robot_tidy=["robotidy", *ALL_ROBOT], - robot_cop=["robocop", *ROBOCOP, *ALL_ROBOT], + robot_tidy=["robocop", "format", *ALL_ROBOT], + robot_cop=["robocop", "check", *ROBOCOP, *ALL_ROBOT], ) if filters: diff --git a/yarn.lock b/yarn.lock index 682e1abcf..25e5fb488 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16799,7 +16799,7 @@ __metadata: languageName: node linkType: hard -"vscode-jsonrpc@npm:8.0.2": +"vscode-jsonrpc@npm:8.0.2, vscode-jsonrpc@npm:^8.0.2": version: 8.0.2 resolution: "vscode-jsonrpc@npm:8.0.2" checksum: 9d055fd4c87ef1093b0eecb5370bfaf3402179b6639149b6d0f7e0bde60cf580091c7e07b0caff868f10f90331b17e7383c087217c077fdd1b5ae7bc23b72f77 @@ -16820,13 +16820,6 @@ __metadata: languageName: node linkType: hard -"vscode-jsonrpc@npm:^8.0.2": - version: 8.2.0 - resolution: "vscode-jsonrpc@npm:8.2.0" - checksum: f302a01e59272adc1ae6494581fa31c15499f9278df76366e3b97b2236c7c53ebfc71efbace9041cfd2caa7f91675b9e56f2407871a1b3c7f760a2e2ee61484a - languageName: node - linkType: hard - "vscode-languageclient@npm:^6.1.3": version: 6.1.4 resolution: "vscode-languageclient@npm:6.1.4" @@ -16956,7 +16949,7 @@ __metadata: languageName: node linkType: hard -"vscode-languageserver-types@npm:3.17.2": +"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": version: 3.17.2 resolution: "vscode-languageserver-types@npm:3.17.2" checksum: ef2d862d22f622b64de0f428773d50a5928ec6cdd485960a7564ebe4fd4a3c8bcd956f29eb15bc45a0f353846e62f39f6c764d2ab85ce774b8724411ba84342f @@ -16970,13 +16963,6 @@ __metadata: languageName: node linkType: hard -"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": - version: 3.17.5 - resolution: "vscode-languageserver-types@npm:3.17.5" - checksum: 79b420e7576398d396579ca3a461c9ed70e78db4403cd28bbdf4d3ed2b66a2b4114031172e51fad49f0baa60a2180132d7cb2ea35aa3157d7af3c325528210ac - languageName: node - linkType: hard - "vscode-languageserver@npm:8.0.0-next.8": version: 8.0.0-next.8 resolution: "vscode-languageserver@npm:8.0.0-next.8"