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

Support doc links to associated functions on other structs #9694

Closed
lf- opened this issue Jul 26, 2021 · 1 comment · Fixed by #15933
Closed

Support doc links to associated functions on other structs #9694

lf- opened this issue Jul 26, 2021 · 1 comment · Fixed by #15933
Labels
A-ide general IDE features C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now

Comments

@lf-
Copy link
Contributor

lf- commented Jul 26, 2021

struct F;
impl F {
    // expect to go here but it fails instead
    fn linkme() {}
}

/// See [`F::linkme`]
//           ^-- go to definition here
fn f1() {}

If I do the above go to definition, it doesn't find a target. rustdoc appears to compile it fine.

The example from #9617 linking to other things on the same top level item does work, it seems to just be linking to things from other top level items that's a trouble here.

Version: 5983d37

@fsktom
Copy link

fsktom commented Jul 11, 2022

The same thing still happens in 5342f47 (v0.3.1123)

E.g. with

struct Foo {}
impl Foo {
    /// [Foo::baz()] - it links correctly in `cargo doc` but not in VSC!
    fn bar(self) {}

    /// [buzz] - linked properly in VSC and `cargo doc`
    fn baz(self) {}
}

fn buzz() {}

only buzz() is linked properly in VSC
image
while in the rustdoc generated docs both are linked correctly
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ide general IDE features C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants