In custom repl commands, is there a way to get hold of the surrounding list? The only relevant vars I see is ~top-level-form and ~form-before-caret. I see that you can pick "Surrounding list" in the exection selection, but I would like to alter the form before executing it. (I'm trying to implement a command to "eval the surrounding thread macro up to here")
Currently my command looks like this:
(->> '~top-level-form
(reverse)
(drop-while #(not= % '~form-before-caret))
(reverse)
(eval))
But I'd like to replace the ~top-level-form with a ~surrounding-list so that it works everywhere.Is there a way to get Cursive to recognise a var has been exposed with https://github.com/clj-commons/potemkin import-vars macro? Say we have the following namespaces
(ns foo)
(defn x [...] ...)
(ns bar
(:require [foo :as f]
[potemkin :as p]))
(p/import-vars [f x])
(ns baz
(:require [bar :as b]))
(defn y [...]
(b/x ...))
At the moment Cursive shows x in the foo namespace as unused (grey-out and can't find the use by potemkin using the :action FindUsages command) and doesn't show if bar/x is unused nor can it find of bar/x.
Ideally Cursive would understand usage by potemkin (`foo/x`, not grey-out, can find usages) and usages of the potemkin version (`bar/x`, grey-out when not used and able to find usages).is it possible, that potemkin is a dependency added by some tools.deps alias, which is not enabled in the Clojure Deps tool window under the Aliases tree leaf?
@onetom We explicitly include it in our projects, so I don't think that's the issue.
I actually did add support for potemkin way back in the day, but it's possible something has broken. I'll try to reproduce with that example, thanks.
Awesome, thanks @cfleming 🙇