This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-02
Channels
- # announcements (13)
- # architecture (18)
- # babashka (90)
- # beginners (80)
- # calva (35)
- # chlorine-clover (29)
- # cider (24)
- # clj-kondo (4)
- # cljfx (3)
- # clojure (60)
- # clojure-australia (2)
- # clojure-europe (60)
- # clojure-france (2)
- # clojure-germany (3)
- # clojure-italy (4)
- # clojure-nl (84)
- # clojure-norway (7)
- # clojure-uk (53)
- # clojurescript (54)
- # clojureverse-ops (1)
- # community-development (6)
- # conjure (1)
- # contributions-welcome (1)
- # cursive (12)
- # datomic (1)
- # fulcro (16)
- # garden (61)
- # girouette (1)
- # graalvm (14)
- # hugsql (1)
- # instaparse (5)
- # jobs-discuss (11)
- # keechma (1)
- # lambdaisland (3)
- # off-topic (20)
- # pathom (1)
- # re-frame (3)
- # reitit (2)
- # releases (1)
- # remote-jobs (2)
- # reveal (11)
- # shadow-cljs (58)
- # spacemacs (5)
- # sql (3)
- # startup-in-a-month (1)
- # vim (2)
For some time, I have been experiencing a delay in getting the exception when I try to evaluate an inline expression (inside VS code editor) with calva jacked-in. I am wondering if this has to do with my setup or this delay is expected. The delay is significant - about 20 sec. For example, if I evaluate (ok 2)
then I get the syntax error about ok
symbol issue after about 20 sec. I dont have anything extra beyond calva’s defaults wrt evaluation process.
@amarjeet, Sounds like this issue: https://github.com/BetterThanTomorrow/calva/issues/929 I thought that problem was fixed…
Currently, when i jack-in, I have the following deps:
clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.2"} cider/cider-nrepl {:mvn/version "0.23.0"} clj-kondo {:mvn/version "2020.04.05"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]
All the dependencies in this command are added by the Calva jack-in process.
The clojure
command will use the :paths
and :deps
from the project deps.edn file (and user wide .clojure/deps.edn
file if it has those keys).
No aliases are specified in the Clojure command, so none are use.
Calva doesn't allow the user to specify aliases from the user wide config, without adding even more config in Calva. This is another reason I use connect rather than jack-in
hey @pez , my deps.edn
file in the ~/.clojure
doesn’t specify any specific version of nrepl
or cider/cider-nrepl
. Are these dependencies being automatically fetched by calva when i jack-in? I have these deps specified in lein
profile, but I am currently using with deps cli.
I guess it is up to lein
which dependency setting get priority. But I think the Calva injections takes priority. That looks like you are using an old version of Calva, btw. So if you upgrade, you should be good.
My calva version is one older than the current one, and re-installing in the vs code re-installs the same version unfortunately. I am gonna try to vs code update, followed by calva update
although in some cases, I am not getting exception at all, its just blank. I will investigate a bit on this about scenarios in which such things are happening.
You need to update nrepl-cider to the latest.
@U067R559Q have updated the versions to the latest one. But, I am still facing the issues - in some cases I get the feedback, in some cases, no feedback at all for bad codes.
Unfortunately, this situation is random so far for me - can’t identify patterns yet wrt to situations in which this occurs.
What is the best practice to know more about java instances, how to find methods of the instance in calva ? Is clojure.reflect/reflect the most elegant method?
Probably not news: https://clojure.org/guides/repl/data_visualization_at_the_repl#_dealing_with_mysterious_values_advanced
So how do you call refrect in practice, you just paste code in editor:
(comment
(require '[clojure.reflect :as reflect])
(require '[clojure.pprint :as pp])
(->> (reflect/reflect con) :members (sort-by :name) (pp/print-table [:name :flags :parameter-types :return-type]))
or is it possible to print this table on keyboard shotcut?You could maybe use custom commands for this. Not sure, but check this out and see if it could help: https://calva.io/custom-commands/
I was listening a podcast about cursive and autor said that he implemented a trick that inspect is triggered at dot key down: (s. and when user selects the method (.toString) form is transfomed to (.toString s|)
{
"name": "reflect",
"snippet": "(require '[clojure.reflect :as reflect]) (require '[clojure.pprint :as pp]) (->> (reflect/reflect $current-form) :members (sort-by :name) (pp/print-table [:name :flags :parameter-types :return-type]))",
"repl": "clj"
}
Way cool. @UCCHXTXV4 pointed me in a direction that I think might make it possible to assign a direct keyboard shortcut to that. Check here: https://github.com/BetterThanTomorrow/calva/issues/1008