-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Generate links to definition in rustdoc source code pages #84176
Merged
+707
−131
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
023231a
Add links on source types to go to definition
GuillaumeGomez 2104bf2
Add an option for the source code link generation
GuillaumeGomez 83dcd30
Ensure that --generate-link-to-definition is only used with HTML outp…
GuillaumeGomez b689ced
Generate links for methods as well
GuillaumeGomez 71763a5
Add test for source code pages URLs
GuillaumeGomez 1abb7fa
Generate links for modules as well
GuillaumeGomez 89bdc33
Update rustdoc tests
GuillaumeGomez b5c27b4
Underline source code links on hover
GuillaumeGomez 2a3b71a
* Rename 'move_span' into 'local_span_to_global_span'
GuillaumeGomez 38444f6
* Rename Span::from_rustc_span to Span::new
GuillaumeGomez c5c927d
Improve code readability
GuillaumeGomez e8869cb
Wrap the span_map tuple index into a type called "LightSpan"
GuillaumeGomez dffc9c0
Move extra arguments for highlight URL generation into a new ContextI…
GuillaumeGomez f233a70
Use rustdoc Span in LinkFromSrc directly
GuillaumeGomez ef0d909
formatting
GuillaumeGomez b336f28
Fix invalid generation of HTML in highlight
GuillaumeGomez 1a48d1a
Add documentation and FIXME
GuillaumeGomez fd69fa8
Add missing root_path when generating links using href
GuillaumeGomez 0799528
* Rename LightSpan::empty into LightSpan::dummy
GuillaumeGomez 5cf300d
Remove warnings/errors from compiler when using typeck_body in rustdo…
GuillaumeGomez dfe4fec
Remove LightSpan and use Span directly
GuillaumeGomez ba11dc7
Fix URL conflict for std type
GuillaumeGomez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally all these
bool
s would instead be new enums. So far there aren't that many, but I'd prefer it to avoid issues in the future.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't exclude each others, so I don't think enums would be helpful here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant newtyping the bools for each field, so that someone doesn't accidentally sets
generate_link_to_definition
to true, when they meant to setshow_type_layout
, although with named fields this is less of a concern.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum... I'm not convinced but I'll open an issue just in case.