-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add support for intra-doc links #6168
Labels
E-has-instructions
Issue has some instructions and pointers to code to get started
E-medium
S-actionable
Someone could pick this issue up and work on it right now
Comments
Veetaha
changed the title
Add goto declaration for intra-doc links
Add support for intra-doc links
Oct 7, 2020
matklad
added
E-has-instructions
Issue has some instructions and pointers to code to get started
E-medium
S-actionable
Someone could pick this issue up and work on it right now
labels
Oct 14, 2020
I think textDocument/documentLink might be a good alternate approach to this. |
I'll try it. |
bors bot
added a commit
that referenced
this issue
Jan 10, 2021
6980: Implement to support intra-doc link r=matklad a=sasurau4 Helps with #6168 This PR is very limited implementation to support intra-doc. It only support links indicate same file function. I want someone to feedback me about this implementation. If the approach is good, I will continue this PR to support other symbols like enum and struct. Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
I think we have the basic support for this already? There are bugs, and the code needs to be refactored for a proper doc pipeline, but that merits separate tracking. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
E-has-instructions
Issue has some instructions and pointers to code to get started
E-medium
S-actionable
Someone could pick this issue up and work on it right now
Intra-doc links rustdoc feature is soon to be shipped with the stable rust toolchain: rust-lang/rust#43466
I propose to add a feature for their support in ide.
The simplest and useful thing that I miss is the ability to navigate to the linked symbol definition in the source code.
Suppose we have the following:
I suggest that when we hover over
[`foo`]
symbol in the doc comment we can usegoto-declaration/definition
and the editor should open the file and the line where the referenced symbol is located, in this case it should be the same file, functionfoo
.The link in
pub fn foo()
documentation should also be actionable and direct us to the source code ofstd::fs::read
function.We might also want to highlight (via semantic tokens) that the given link is an intra-doc link (maybe even preserving the information about the symbol kind (function/variable/struct/trait...)).
The initial implementation of this feature might just use the current path resolving instrumentation of rust-analyzer and this will already be very useful, after that we might also support path disambiguation syntax of intra-doc links, maybe even suggest completions?
The text was updated successfully, but these errors were encountered: