rust-playground icon indicating copy to clipboard operation
rust-playground copied to clipboard

Request: include action button state in share link

Open scottmcm opened this issue 2 years ago • 2 comments

It's really nice that I can look at LLVM-IR or ASM or … on the playground.

But sadly, when I get a share link https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=ceb427b607c3f033c94a0b7541f35dda, it doesn't include the button state, so whoever opens it ends up just on "Build" (or "Run") instead.

When I'm trying to show something in the MIR, it would be nice if I could get a share link that opens to "MIR ►", rather than something where when they Ctrl-Enter it just says "yup, it compiled" (essentially).

scottmcm avatar Mar 24 '23 03:03 scottmcm

In general, this wouldn't be terribly hard to do. If someone wants to contribute, it should mostly be a matter of copy/pasting how things like the edition flow into the gist state and are serialized to/from the URL.

The main ergonomic issue is that we don't have a way to go back from a manually-selected action to the automatic "do what feels right" action. Adding this feature will make it more likely for people to get into that state, especially without actively making the decision to do so.

shepmaster avatar Mar 24 '23 14:03 shepmaster