rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.08k stars 1.57k forks source link

documentation tooltip links to nonsensical docs.rs page #10646

Open jhgg opened 2 years ago

jhgg commented 2 years ago

Given this code:

struct Foo;

/// Like [`Foo`] but better.
struct Bar;

fn main() {
    let x = Ba$0r;
}

A hover produces:

image

Foo when clicked, links to: https://docs.rs/rust_playground/*/rust_playground/struct.Foo.html

I think it should behave like these links:

image and just navigate you to the relevant item in the editor.

Veykril commented 2 years ago

Hmm, yeah for local crates we probably want to link to the items in source, but for dependencies we still want to link to the doc.rs site.

Edit: Also https://github.com/rust-analyzer/rust-analyzer/issues/6332 seems to be related

JensMertelmeyer commented 2 weeks ago

Here is a small animation that highlights the issue.

Recording 2024-09-02 at 09 12 05

I still have no idea how to circumvent this if your documentation is not publicly hosted at docs.rs.