Skip to content

Treat intra-doc links as references to be renamed or found #8242

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

Open
kpreid opened this issue Mar 29, 2021 · 3 comments
Open

Treat intra-doc links as references to be renamed or found #8242

kpreid opened this issue Mar 29, 2021 · 3 comments
Labels
E-unknown It's unclear if the issue is E-hard or E-easy without digging in S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@kpreid
Copy link
Contributor

kpreid commented Mar 29, 2021

It seems that intra-doc links are not counted as references for purposes of Rename or Find All References. It would be useful if they were. (This might count as part of #6168, but the description there seems focused on following links rather than finding them.)

The support for this would also probably make it easy to show broken links as problems immediately (right now, I have to run cargo doc to check for them).

@Veykril Veykril added S-actionable Someone could pick this issue up and work on it right now E-unknown It's unclear if the issue is E-hard or E-easy without digging in S-unactionable Issue requires feedback, design decisions or is blocked on other work and removed S-actionable Someone could pick this issue up and work on it right now labels Mar 29, 2021
@Veykril
Copy link
Member

Veykril commented Mar 29, 2021

This definitely sounds like something desirable but requires a bit of design in how we do the search for them, as references in docs aren't proper nodes like other names but just parts of the comment nodes.

@matklad
Copy link
Member

matklad commented May 21, 2021

requires a bit of design

Yeah, we need ide::Refernece, like we have ide::Definition, to handle this clearly.

@clarfonthey
Copy link
Contributor

I'm not sure what exactly needs to be done to get this to work. Right now, if I rename a symbol, I have to update all of the intradoc links manually, since they aren't touched.

One potentially weird case for this is that imports which are marked as #[cfg(doc)] may apply when resolving these links.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-unknown It's unclear if the issue is E-hard or E-easy without digging in S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

4 participants