`onConnect` sequences in `calva/config.edn`
I have not been able to find out this via documentation, but is it possible to fill out the calva.autoEvaluateCode.onConnect inside the calva/config.edn file instead of vscode settings JSON?
If it is not possible, does it sound like something to be considered for a future capability?
Thanks!
Hello, thanks for reaching out!
Short answer:
- It is not possible.
- I am not sure we can go that way.
As for not going that way, can you describe your use case? If there is some clear reason what would be enabled, we can certainly consider.
Elaboration:
The reason some things can be configured there are two-fold:
- Calva supports some config to be provided by libraries. And then EDN makes much more sense than JSON.
- The custom command snippets that can be provided via EDN is all about Clojure code, which is much easier to express in EDN than in JSON.
We really should document the config.edn a bit.
Sure! My use case is mainly to have some common utils that I don't have in any repository - just locally - and want to inject into calva repl jack in. For a specific example, I have a wrapper around the tap> function to do some custom stuff for Portal, and if I can link this to repl jack in instead of needing to call a custom command it would be better.
I guess I can do this via lein, but I sometimes use deps as well and was looking for the possibility of having some "injections" in calva directly. To be fair, I can do this with the calva.autoEvaluateCode.onConnect option, its just that its a bit complicated to have a big string of clojure code there in the json format
Thanks. That sounds like it is for similar reasons that we have some config in EDN today. I think it makes sense. There is prior art in reading config from EDN so maybe it is within reasonable reach to also read connect sequences this way.