This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-23
Channels
- # announcements (5)
- # aws (9)
- # babashka (60)
- # beginners (561)
- # calva (8)
- # cider (17)
- # clj-kondo (1)
- # cljsrn (12)
- # clojure (36)
- # clojure-dev (3)
- # clojure-europe (3)
- # clojure-france (10)
- # clojure-greece (8)
- # clojure-italy (6)
- # clojure-spec (3)
- # clojure-uk (6)
- # clojurescript (30)
- # community-development (2)
- # conjure (15)
- # datascript (24)
- # figwheel-main (49)
- # fulcro (29)
- # helix (72)
- # off-topic (20)
- # pathom (7)
- # rum (7)
- # shadow-cljs (23)
- # spacemacs (6)
- # sql (8)
- # timbre (1)
- # xtdb (10)
Is there an alternative to deps.clj for making Uberscript?
In the example of the documentation it uses deps.clj though. So the logic is to concatenation all the required files into a single one and append the main function in the user Ns?
well, the main function stays in the same namespace it was in, but the invocation of the main namespace is also going into the uberscript
I should write a bb script that does it :)
Before I dig more into it, does bb --nrepl-socket
have support for eldoc
when using it with cider?
Might be a problem with my setup
@dromar56 Does that require a cider nrepl middleware thing? I don't think it's in there right now
@dromar56 Maybe you could try it with normal Clojure and then inspect the *nrepl-messages*
to see what gets sent back and forth.
Also see: https://docs.cider.mx/cider/troubleshooting.html#_debugging_the_communication_with_nrepl
Seems like there's an eldoc op:
(-->
id "40"
op "eldoc"
session "52835e30-dd83-4092-adf6-4c529a995bb1"
time-stamp "2020-05-23 17:39:41.254514485"
ns "user"
symbol "foo"
)
@U051BLM8F can we find docs on this op somewhere?
(-->
id "40"
op "eldoc"
session "52835e30-dd83-4092-adf6-4c529a995bb1"
time-stamp "2020-05-23 17:39:41.254514485"
ns "user"
symbol "foo"
)
(<--
id "40"
session "52835e30-dd83-4092-adf6-4c529a995bb1"
time-stamp "2020-05-23 17:39:41.259135909"
docstring nil
eldoc (("x" "y"))
name "foo"
ns "user"
status ("done")
type "function"
)
Seems like it returns the docstring too, here's a more complete one (used on defn
):
(-->
id "46"
op "eldoc"
session "52835e30-dd83-4092-adf6-4c529a995bb1"
time-stamp "2020-05-23 17:45:12.853910691"
ns "user"
symbol "defn"
)
(<--
id "46"
session "52835e30-dd83-4092-adf6-4c529a995bb1"
time-stamp "2020-05-23 17:45:12.856334080"
docstring "Same as (def name (fn [params* ] exprs*)) or (def
name (fn ([params* ] exprs*)+)) with any doc-string or attrs added
to the var metadata. prepost-map defines a map with optional keys
:pre and :post that contain collections of pre or post conditions."
eldoc (("name" "doc-string?" "attr-map?" "[params*]" "prepost-map?" "body")
("name" "doc-string?" "attr-map?" "([params*] prepost-map? body)" "+" "attr-map?"))
name "defn"
ns "clojure.core"
status ("done")
type "function"
)
Seems easy enough to support in babashka.nrepl. If you want, you can provide a PR with tests: https://github.com/babashka/babashka.nrepl
the babashka.nrepl library can be tested entirely in the JVM which makes iterating on it go faster. but eventually the dep has to be updated in bb and then will be compiled with graalvm
it's really nice that these improvements will also benefit other CLIs. cc @U1QQJJK89
it's the editors who issue an eldoc request, so it doesn't break anything if you implement additional ops
I guess editor like vim fireplace or conjure could also issue an eldoc command? @U38J3881W?
on the bottom line you can see the arguments of the function, and depending on where the cursor is the corresponding argument is bolded (in the screenshot the "x" is in bold, had my cursor been at "20" the "y" would be bold instead)
Yep, i don't issue eldoc commands in Conjure but I probably will do at some point. I'll probably show the arg list in highlighted virtual text beside the line rather than at the bottom of nvim. Neovim doesn't really have the minibuffer sort of thing (I think that's what it is in emacs?)
Instructions how to build a sci-based GraalVM app with java11: https://github.com/borkdude/sci#java-11
Upgraded bb to GraalVM java-11 20.1.0. Binaries in #babashka_circleci_builds. Would appreciate if you could try it out 🙂
One issue that it should fix is this one: https://github.com/borkdude/babashka/issues/444
seems to work over here:
$ TZ=GMT+1 ./bb '(java.time.ZoneId/systemDefault)'
#object[java.time.ZoneRegion 0x197bd2b8 "GMT+01:00"]
$ ./bb '(System/setProperty "user.timezone" "GMT+3") (java.time.ZoneId/systemDefault)'
#object[java.time.ZoneRegion 0x76a3e81f "GMT+03:00"]
Is there a good test runner in bb? I know that clojure.test is there, but having some way of running all tests in the tests dir would be nice. I tried using the cognitect test runner, but it depends on tools.namespace, which has protocols.
@nate To be honest, I think a little test runner script like this works in most cases: https://github.com/borkdude/babashka#running-tests
hmm, adding bean
to the next bb... 🙂
$ ./bb '(bean (java.time.ZoneId/systemDefault))'
{:class java.time.ZoneRegion, :id "Europe/Amsterdam", :rules #object[java.time.zone.ZoneRules 0x333fe8db "ZoneRules[currentStandardOffset=+01:00]"]}