This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
I found this cool cursive repl hook : https://www.reddit.com/r/Clojure/comments/lzx0zb/did_you_know_that_ideacursive_repl_results_may_be/. Is there a intellij API that we can call to put that contents into the clipboard?
https://plugins.jetbrains.com/docs/intellij/working-with-text.html#safely-replacing-selected-text-in-the-document seems pretty close
public abstract void setContents(@NotNull Transferable content); Transferrable content = ...; CopyPasteManager.getInstance().setContents(content);
CopyPasteManager.getInstance().setContents(new StringSelection("hello world"));
So the real q is: how do i "cross the streams" and run some code in the cursive process?
Something like this? https://clojurians.slack.com/archives/C0744GXCJ/p1644978986077219
(let [s (java.util.UUID/randomUUID)]
(.setContents (.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit))
(java.awt.datatransfer.StringSelection (str s))
nil))
yeah looks great