Rustdoc should allow copying use
statements into clipboard with 1 click
#50239
Labels
A-rustdoc-ui
Area: Rustdoc UI (generated HTML)
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Uh oh!
There was an error while loading. Please reload this page.
The intention of many (if not most) visits to any crate doc (e.g. on docs.rs but also std) is to find out the import paths, so that one can write the right
use
statement for the symbol.So Rustdoc should allow copying
use
statements into the clipboard with 1 click.There should be a copy icon next to the name of each type/trait/module, which will cause a
use
statement for this symbol to be copied to the user's clipboard ("use {};\n"
).For easy pasting into the editor after lookup up the path of the symbol.
I always find myself manually selecting the path (carefully avoiding clicking its link but also not selecting any chars before and after, which is annoying*), then copying, pasting and writing
use
before and;\n
after it, for many symbols, which wouldn't be necessary with this feature.The icon could be something from FontAwesome or similar (that's instantly recognizable as a "copy-to-clipboard" icon.)
*Also, why is the symbol even a link, always to its page which is the same page, when the user is already on that page? (We could just change (re-purpose) this link to copy the
use
-statement to the clipboard, but it won't be as obvious as with a copy icon.)The text was updated successfully, but these errors were encountered: