-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 macro expansion in rustdoc source code pages #137229
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
"{closing}\ | ||
<span class=expansion>\ | ||
<input id={id} type=checkbox>\ | ||
<label for={id}>↕</label>{reopening}", |
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.
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.
Because it would force to duplicate all the common code. For example in:
func(arg, macro!(blabla), arg3);
Only macro!(blabla)
will be different, so it's not interesting to duplicate all the rest. Instead, we put the original code in a span
, the expanded one in another and then we can simply switch them based on the status of the checked
property of the input. I'm also not a big fan of our current details
approach as it requires more JS to be working fully as expected but it's a debate for another time.
This comment has been minimized.
This comment has been minimized.
49a5ec0
to
9446a39
Compare
This comment has been minimized.
This comment has been minimized.
9446a39
to
f0bf946
Compare
f0bf946
to
faf64fa
Compare
This comment has been minimized.
This comment has been minimized.
This PR modifies cc @jieyouxu |
This comment has been minimized.
This comment has been minimized.
I opened the firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1949948 |
☔ The latest upstream changes (presumably #137511) made this pull request unmergeable. Please resolve the merge conflicts. |
d54f0d0
to
a3e1a8b
Compare
This comment has been minimized.
This comment has been minimized.
a3e1a8b
to
8b1c7cb
Compare
8b1c7cb
to
b666b7f
Compare
PR is ready for review. |
This is what it looks like:
You can test it here. In this case, I also enabled the
--generate-link-to-definition
to show that both options work well together.Note: There is a bug currently in firefox where the line numbers are not displayed correctly if they're inside the "macro expansion" span. I didn't open a bug report yet, I plan to do so when I have a bit of time.
r? @notriddle