microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.67k stars 770 forks source link

"Go to definition" opens a new tab (undesired behavior) #6054

Closed ibobak closed 3 days ago

ibobak commented 4 days ago

Type: Bug

If I have a notebook open on the left side and a module on the right (and this is the layout which I would like to keep), and if I do "go to definition" in the notebook, it will open a new tab.

Video of how to reproduce: https://youtu.be/1hYO4y1ocDw

image

Extension version: 2024.6.1 VS Code version: Code 1.90.2 (5437499feb04f7a586f677b155b039bc2b3669eb, 2024-06-18T22:33:48.698Z) OS version: Linux x64 6.4.6-060406-generic Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Xeon(R) CPU E5-2696 v4 @ 2.20GHz (88 x 2994)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|3, 3, 2| |Memory (System)|251.76GB (53.22GB free)| |Process Argv|--crash-reporter-id 27d42247-63fb-4d9e-9cb0-87d9974843dc| |Screen Reader|no| |VM|50%| |DESKTOP_SESSION|ubuntu-xorg| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu-xorg| |XDG_SESSION_TYPE|x11|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 jchc7451:31067544 chatpanelt:31048053 dsvsc021:30996838 9c06g630:31013171 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupyter:31046869 2f103344:31071589 legacy_priority:31077528 ```
rchiodo commented 3 days ago

Thanks for the issue, but this isn't something that Pylance controls. VS code decides where the tab opens. We merely provide VS code with the URL of the file where the definition is. You'd have to ask VS code to provide a way to control where the tab opens.

ibobak commented 2 days ago

Thank you. I will report a bug to VS Code then.

ibobak commented 2 days ago

Of course it would be good if you could do this somehow automatically, so that we (the end users) wouldn't spend our time on that.