jupyterlab-go-to-definition icon indicating copy to clipboard operation
jupyterlab-go-to-definition copied to clipboard

Wrong reference to shadow name

Open guoquan opened this issue 5 years ago • 1 comments

When I have a property of an object with the same name as a local variable, alt+click always points me to the local variable even if I want the property. An example to reproduce the error could be as follows:

name = 'hello'
obj = object()
obj.name = 'world'
print(obj.name)

and when you alt+click on name on print line, it goes to 'hello' line.

guoquan avatar Oct 10 '19 18:10 guoquan

Thank you for reporting this issue. This behaviour is indeed not ideal, however, it might be difficult to fix with the current design of this extension.

This should be easier to implement in jupyterlab-lsp but it does not work there yet either (without any in-depth testing I think that we are currently passing .name to the LSP server but we may need to pass obj.name).

This is a useful test-case, thank you again for your feedback.

krassowski avatar Oct 11 '19 22:10 krassowski