You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a mouse cursor is moving when a hover is triggered, the tooltip information can be stored to a wrong location. Here, I mean "trigger" by the initial appearance of the underline to a target token.
In this example, sin shows an incorrect tooltip that is actually from math. The data is cached so this behavior stays once it occurs.
Reproduce
[Optional but recommended] Go to "Advanced Setting Editor" → "Code hover" → "Throttler delay", and set the value to 500 or more to make the reproduction easy.
Point a token with a mouse cursor, and then point another token within the delay period. Timing of Ctrl key pressing does not matter, by the way.
Discussion
I found this problem when I was preparing a PR for #362. The root of this problem is that the throttler is not always in the same page as each caller. Specifically, this.debounced_get_hover.invoke() does not always use the same this.virtual_position as it was assigned before the call if the throttler is invoked multiple times during a period.
I could get around this hover problem by checking if this.debounced_get_hover.invoke() referred to the same virtual position as the one in _updateUnderlineAndTooltip. Will send a PR later.
The text was updated successfully, but these errors were encountered:
Description
When a mouse cursor is moving when a hover is triggered, the tooltip information can be stored to a wrong location. Here, I mean "trigger" by the initial appearance of the underline to a target token.
In this example,
sin
shows an incorrect tooltip that is actually frommath
. The data is cached so this behavior stays once it occurs.Reproduce
[Optional but recommended] Go to "Advanced Setting Editor" → "Code hover" → "Throttler delay", and set the value to 500 or more to make the reproduction easy.
Point a token with a mouse cursor, and then point another token within the delay period. Timing of Ctrl key pressing does not matter, by the way.
Discussion
I found this problem when I was preparing a PR for #362. The root of this problem is that the throttler is not always in the same page as each caller. Specifically,
this.debounced_get_hover.invoke()
does not always use the samethis.virtual_position
as it was assigned before the call if the throttler is invoked multiple times during a period.https://github.com/jupyter-lsp/jupyterlab-lsp/blob/master/packages/jupyterlab-lsp/src/features/hover.ts#L446
I could get around this hover problem by checking if
this.debounced_get_hover.invoke()
referred to the same virtual position as the one in_updateUnderlineAndTooltip
. Will send a PR later.The text was updated successfully, but these errors were encountered: