Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type hover/tooltip links always link to outer-most type #17628

Closed
seritools opened this issue Jul 18, 2024 · 6 comments · Fixed by #17709
Closed

Type hover/tooltip links always link to outer-most type #17628

seritools opened this issue Jul 18, 2024 · 6 comments · Fixed by #17709
Assignees
Labels
A-vscode vscode plugin issues C-bug Category: bug E-easy E-has-instructions Issue has some instructions and pointers to code to get started

Comments

@seritools
Copy link

seritools commented Jul 18, 2024

image

When clicking String or Global in this info tooltip/hover UI, it always goes to Vec. Generally, it seems to go to the "outer-most" type instead of the one you clicked. This is of course especially annoying when looking at something with an inferred type ^^

rust-analyzer version: rust-analyzer version: 0.4.2040-standalone (a62ea0a59 2024-07-17)

rustc version: rustc 1.79.0 (129f3b996 2024-06-10)

editor or extension:

Version: 1.92.0-insider (user setup)
Commit: 65a6a2f783dbc87fb3b1408c6a9b3e8d455a60a2
Date: 2024-07-18T05:04:30.247Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.26100

code snippet to reproduce:

pub struct Foo {
    pub bar: Vec<String>,
}

and hover over bar

@seritools seritools added the C-bug Category: bug label Jul 18, 2024
@roife
Copy link
Member

roife commented Jul 19, 2024

🤔 It works fine for me.

未命名

@seritools
Copy link
Author

🤔 that's weird. It's been broken for me for quite some time. In fact, it's broken for me even on the stable r-a extension version. :s

@Young-Flash
Copy link
Member

can reproduce on windows wsl

@roife
Copy link
Member

roife commented Jul 19, 2024

I don't know what happened, but now I can also reproduce this bug now. 🫠

@Veykril
Copy link
Member

Veykril commented Jul 19, 2024

Assuming the bug is only a couple weeks old it might be due to ff07caa#diff-bca0ed357f47caaadd008edc9b2df19f36869583b78c2c0265b9f0db3650df2e which changed some vscode specific handling here.

@Veykril
Copy link
Member

Veykril commented Jul 19, 2024

Oh ye thats it 🤦 We overwrite the global for every link so only the last one persists. That global ought to track an array of links which gets overwritten on the next hover, not when rendering a command ff07caa#diff-bca0ed357f47caaadd008edc9b2df19f36869583b78c2c0265b9f0db3650df2eR402

@Veykril Veykril added E-easy E-has-instructions Issue has some instructions and pointers to code to get started A-vscode vscode plugin issues labels Jul 19, 2024
@Young-Flash Young-Flash self-assigned this Jul 21, 2024
@bors bors closed this as completed in aae54dd Jul 26, 2024
lnicola pushed a commit to lnicola/rust that referenced this issue Jul 28, 2024
RalfJung pushed a commit to RalfJung/rust that referenced this issue Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vscode vscode plugin issues C-bug Category: bug E-easy E-has-instructions Issue has some instructions and pointers to code to get started
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants