microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.67k stars 29.07k forks source link

Go to definition opening dependency in wrong package in monorepo #231124

Open rmclaughlin-nelnet opened 1 week ago

rmclaughlin-nelnet commented 1 week ago

Type: Bug

When working in a monorepo if I have package A and package B and both packages use the same dependency C. If I right click a dependency function name package A and choose go to definition I will often times get the dependency from package B. If they are both the same version that would be manageable but often times even though they have the same dependency they are at different version which means I will be getting an incorrect view of the dependency.

I have tested this will all extensions disabled and it still happens.

VS Code version: Code 1.94.0 (Universal) (d78a74bcdfad14d5d3b1b782f87255d802b57511, 2024-10-02T13:08:12.626Z) OS version: Darwin arm64 23.6.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M1 Pro (10 x 2400)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|5, 5, 5| |Memory (System)|32.00GB (0.58GB free)| |Process Argv|--crash-reporter-id 3dc34584-bb88-4976-8f2e-c363cdd222cc| |Screen Reader|no| |VM|0%|
Extensions (18) Extension|Author (truncated)|Version ---|---|--- vscode-openapi|42C|4.29.2 vscode-base64|ada|0.1.0 vscode-eslint|dba|3.0.10 gitlens|eam|15.6.0 EditorConfig|Edi|0.16.4 json-tools|eri|1.0.2 copilot|Git|1.238.0 copilot-chat|Git|0.21.1 terraform|has|2.32.3 prettier-sql-vscode|inf|1.6.0 jwt-decoder|jfl|1.2.0 json|Mee|0.1.2 ecdc|mit|1.8.0 vscode-xml|red|0.27.1 vscode-yaml|red|1.15.0 open-in-browser|tec|2.0.0 pdf|tom|1.2.2 local-history|xyz|1.8.1
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyonecf:30548226 962ge761:30959799 pythongtdpath:30769146 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 f3je6385:31013174 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 impr_priority:31102340 nativerepl2:31139839 refactort:31108082 pythonrstrctxt:31112756 wkspc-onlycs-t:31132770 wkspc-ranged-t:31151552 cf971741:31144450 defaultse:31146405 iacca1:31156133 notype1cf:31151524 5fd0e150:31155592 ```
vs-code-engineering[bot] commented 1 week ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.94.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

rmclaughlin-nelnet commented 1 week ago

I updated to the latest version and it still occurs.

Here is a screenshot of what I see Image

mjbvz commented 21 hours ago

Please try to put together a small example project which demonstrates the issue so we can take a look