jupyterlab-lsp icon indicating copy to clipboard operation
jupyterlab-lsp copied to clipboard

Jump to definition bug with repeated definitions

Open mlucool opened this issue 2 years ago • 3 comments

Description

If a function is defined twice, jump to definition always jumps to the first definition and not the latest.

Reproduce

jump-to-def

Expected behavior

The second add should jump to the add right above it.

Context

mlucool avatar Jun 21 '22 22:06 mlucool

Interesting, I cannot reproduce, neither on master nor on Binder with an older version (using python-lsp-server):

cannot-repro

There is selector for the case if language server returns multiple targets (#739) but it was not released yet; in any case it seems pylsp returns only the correct match. It could however vary depending on dependencies of pylsp itself (jedi?).

krassowski avatar Jun 23 '22 21:06 krassowski

I can see that pyright returns both options. In the current stable version indeed the first one is always chosen. On master (with #739) we get a rudimentary selector:

jumpselector

We can improve the rendering of it greatly (e.g. show the actual cell) in the future.

krassowski avatar Jun 23 '22 21:06 krassowski

@mlucool the jump target selector was included in v4.0.0. Can we close this issue?

krassowski avatar Mar 15 '23 18:03 krassowski