diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b19f2807..6120c081e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Requires JupyterLab `>=3.6.0,<4.0.0a0` and Python 3.8 or newer. - fix `undefined` being inserted for path-like completion items with no `insertText` ([#833]) - reduce signature flickering when typing and hover flicker when moving mouse ([#836]) - fix sporadic misplacement of hover tooltips ([#860], thanks @yamaton) + - fix hover tooltip not updated after character deletions ([#867], thanks @yamaton) - handle potential race condition in feature settings loading ([#882]) - refactoring: - changed NPM packages namespace from `@krassowski` to `@jupyter-lsp` ([#862]) @@ -63,6 +64,7 @@ Requires JupyterLab `>=3.6.0,<4.0.0a0` and Python 3.8 or newer. [#852]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/852 [#860]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/860 [#864]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/864 +[#867]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/867 [#882]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/882 [#893]: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/893 diff --git a/atest/05_Features/Hover.robot b/atest/05_Features/Hover.robot index 420c258b6..ad2f7e781 100644 --- a/atest/05_Features/Hover.robot +++ b/atest/05_Features/Hover.robot @@ -66,6 +66,19 @@ Hover works in foreign code (javascript) Trigger Tooltip Math Element Should Contain ${HOVER_BOX} Math: Math +Update hover after character deletion + Enter Cell Editor 4 + Trigger Tooltip atan2 + Element Text Should Be ${HOVER_SIGNAL} atan2 + Capture Page Screenshot 01-hover-before-delection.png + Element Should Contain ${HOVER_BOX} atan2(y: SupportsFloat, x: SupportsFloat, /) + Place Cursor In Cell Editor At 4 line=2 character=13 + Press Keys None DELETE + Trigger Tooltip atan + Element Text Should Be ${HOVER_SIGNAL} atan + Capture Page Screenshot 02-hover-after-delection.png + Element Should Contain ${HOVER_BOX} atan(x: SupportsFloat, /) + *** Keywords *** Last Occurrence diff --git a/atest/05_Features/Jump.robot b/atest/05_Features/Jump.robot index 0b2746d06..13cfc277f 100644 --- a/atest/05_Features/Jump.robot +++ b/atest/05_Features/Jump.robot @@ -89,7 +89,7 @@ Clean Up Folder With Spaces FOR ${file} IN @{files} Remove File ${NOTEBOOK DIR}${/}${FOLDER WITH SPACE}${/}${file} END - Remove Directory ${NOTEBOOK DIR}${/}${FOLDER WITH SPACE} recursive=True + Remove Directory ${NOTEBOOK DIR}${/}${FOLDER WITH SPACE} recursive=True Select Token Occurrence [Arguments] ${token} ${type}=variable ${which}=last diff --git a/atest/examples/Hover.ipynb b/atest/examples/Hover.ipynb index c6dc73b89..e68905259 100644 --- a/atest/examples/Hover.ipynb +++ b/atest/examples/Hover.ipynb @@ -37,6 +37,16 @@ "%%javascript\n", "Math" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import math\n", + "z = math.atan2(0.4, 0.3)\n" + ] } ], "metadata": { diff --git a/packages/jupyterlab-lsp/src/editor_integration/editor_adapter.ts b/packages/jupyterlab-lsp/src/editor_integration/editor_adapter.ts index 8aa299856..f4dab15aa 100644 --- a/packages/jupyterlab-lsp/src/editor_integration/editor_adapter.ts +++ b/packages/jupyterlab-lsp/src/editor_integration/editor_adapter.ts @@ -68,8 +68,13 @@ export class EditorAdapter> { return true; } - if (!change || !change.text.length || !change.text[0].length) { - // deletion - ignore + if ( + !change || + ((!change.text.length || !change.text[0].length) && + (!change.removed || + !change.removed.length || + !change.removed[0].length)) + ) { return true; }