Add button "copy import statement to clipboard"
Would be nice to have a small button next to functions (and other things) to format an import statement and copy it to the clipboard
Could be added here in the code https://github.com/purescript/pursuit/blob/3209916030e5bae48d4e77e7ee1e6ee833192a1b/src/Handler/Search.hs#L319
I kind of find it hard to justify this because I feel like this is a very rare use case. Put differently, is this just going to clutter up the UI if we add a button like this?

Something like this, but better designed button. Probably could go on the module page too (screenshot is from search). Button could also be placed top-right similar to where Source is located next to functions in module docs.
I think the use case of looking up docs and then typing module name and function name into your code is very frequent. Now i usually scroll to top of page, copy the module name. And then i do this import <CTRL + V> (<function name i remembered>).
@JordanMartinez how does your workflow look like?
:facepalm: I literally thought this issue was on the Try PureScript repo...
Ok. The copy import button does make sense.
What are your thoughts on making the proposed button also copy it as a qualified import that the user defines? So,
- user interacts with the button (e.g. Ctrl+Click to trigger this behavior)
- an input appears and is focused
- user types in some alias (e.g. "Functor") and types Enter
- the following is copied to your clipboard:
import Data.Functor as Functor
Seems like a good idea to me :)
I'm thinking whether it would pay off to have a toggle (i.e. checkbox) to enable/disable the popup somewhere (toggle state stored on the browser)
:man_shrugging: I don't know, but I would focus on getting your original idea in first. Otherwise, it may never get implemented due to focusing too much on my suggestions.