This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-31
Channels
- # aleph (24)
- # announcements (2)
- # aws (1)
- # babashka (2)
- # beginners (46)
- # calva (15)
- # chlorine-clover (1)
- # clojure-europe (27)
- # clojure-nl (3)
- # clojure-norway (13)
- # clojure-uk (7)
- # clojurescript (16)
- # datomic (29)
- # emacs (4)
- # fulcro (16)
- # hugsql (6)
- # hyperfiddle (65)
- # lsp (9)
- # malli (3)
- # off-topic (29)
- # pedestal (1)
- # releases (1)
- # shadow-cljs (52)
- # specter (5)
- # xtdb (1)
Would it be possible to have actions that create bindings (move to let, extract fn, etc) either prompt for a binding name or put 2 cursors highlighting the binding def and use? Every time I use one I have to go change the binding name by hand afterwards
The clojure-lsp command for extracting a function (not the refactoring version) prompts for a function name. I have that bound to a keyboard shortcut. Not sure this is what you are asking for, though. 😀
I don’t know, tbh. It’s a clojure-lsp feature, so if it is changed there it will change in Calva.
I'm currently trying to make a hover snippet, and it's not going well. Here's what I got so far:
"calva.customREPLHoverSnippets": [
{
"name": "eval thing on hover",
"snippet": "\"I'm making more hover items\""
},
]
I assume this would eval in my repl session (I see nothing in the calva repl or nrepl logging) and add the string I'm making more hover items
to the hover list. Even after reloading VSCode I don't see any extra hover content though. This is in my settings.json
fwiw.Curiously I get a docstring when I put the snippet in the workspace settings json, not the user settings json
This could be a bug with how we merge this setting. @U02EMBDU2JU do you see a reason why it wouldn’t work with user settings?
No. I’ve run into that myself and ran the scenario through the debugger and couldn’t figure it out. If I remember correctly, it works in the test project, so I thought my setup might be weird. I’ve put it into config.edn instead. If it works in workspace setting but not in the user settings it would explain why our test setup is fine and why my setup was broke 🙂
I guess the merge is a bit special since we have the edn config in the mix as well. Issue welcome, @U5P29DSUS!
Has anyone written a utility for repl commands to resolve the full name of a symbol? i.e. convert $current-form
, which may be ::namespaced/keyword
, to :the.actual.namespace/keyword
? Currently making my own based on ns-aliases, but if it's built in that'd be great.
#?(:clj
(defn realize-symbol
[ns-str symbol-str]
(let [[_ kw? ns_ name_ :as match] (re-matches #"^(\:\:)?([^:]+)\/(.+)$" symbol-str)
actual-ns-str (when ns_ (or (some-> ns-str (symbol) (ns-aliases) (get (symbol ns_)) (ns-name) (str))
ns_))]
(cond (not ns_) (read-string symbol-str)
kw? (keyword actual-ns-str name_)
:else (symbol actual-ns-str name_)))))