Skip to content

Instantly share code, notes, and snippets.

@armed
Created June 18, 2022 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save armed/b5e8fd111b080587fd6a36f103eb333b to your computer and use it in GitHub Desktop.
Save armed/b5e8fd111b080587fd6a36f103eb333b to your computer and use it in GitHub Desktop.
(ns clear-repl
(:require ["vscode" :as vscode]
["fs" :as fs]
[joyride.core :as joyride]))
(defn main []
(doseq [e vscode/window.visibleTextEditors]
(let [f-name (.. e -document -fileName)]
(when (.endsWith f-name "output.calva-repl")
(fs.writeFileSync f-name "", "utf8")))))
(when (= (joyride/invoked-script) joyride/*file*)
(main))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment