This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-11
Channels
- # announcements (38)
- # babashka (5)
- # beginners (26)
- # calva (26)
- # cider (1)
- # clj-kondo (36)
- # cljdoc (17)
- # cljs-dev (31)
- # clojure (39)
- # clojure-australia (9)
- # clojure-berlin (2)
- # clojure-dev (31)
- # clojure-europe (22)
- # clojure-france (3)
- # clojure-italy (7)
- # clojure-nl (5)
- # clojure-norway (5)
- # clojure-spec (28)
- # clojure-uk (9)
- # clojured (20)
- # clojurescript (24)
- # community-development (2)
- # conjure (32)
- # core-async (7)
- # cryogen (6)
- # datomic (2)
- # duct (6)
- # fulcro (6)
- # graalvm (53)
- # introduce-yourself (2)
- # jobs (2)
- # luminus (2)
- # nrepl (2)
- # off-topic (35)
- # re-frame (17)
- # reveal (8)
- # shadow-cljs (27)
- # testing (2)
- # xtdb (8)
Is there any specific requirement that I need to get Jack in Running? I’m trying to start a project whose deps.edn file is not in the root directory but nothing happens. It works if I open VSCode in a way that deps.edn is in the root. Is there a way to change this?
A believe a deps.edn file is required at the root of the opened project. CC @U0ETXRFEW
I don't think so. There's a note about that requirement here: https://calva.io/connect/#jack-in-let-calva-start-the-repl-for-you
It’s not a big deal — I have essentially some openfaas functions and each of them has its own directory and deps.end file
I don’t know what is going on. Despite that note in the docs, you are supposed to be able to have a structure like:
- foo
- bar
- deps.edn
- src
- baz.clj
And having baz.clj
open jack-in should work. It does when I try it. Can you create a minimal repro of the problem? That will make it easier to figure out.@U0ETXRFEW Should we update the docs to mention that?
Yes, we should probably try to describe how the project root is determined on this page https://calva.io/workspace-layouts/ and link to it from the connect page.
Quick question: is there a way to specify a namespace to be auto-loaded on jack-in? I’ve been having to manually eval my user.clj
file and can’t seem to find a setting for that. Maybe it’s deps.edn specific?
You could specify with afterCLJReplJackInCode
Yeah, just tested it and it would work. Inside of settings.json
👉 calva.replConnectSequences
create/edit a sequence and in the object add: "afterCLJReplJackInCode": "(ns my-ns.core)"
Full object was…
{
"name": "Leiningen Ex",
"projectType": "Leiningen",
"cljsType": "none",
"afterCLJReplJackInCode": "(ns my-ns.core)",
"menuSelections": {
"leinAlias": null,
"leinProfiles": [
"dev",
"repl",
"user"
]
}
}
Hm that doesn’t seem to work for my deps.edn project. I see (ns user)
get evaluated resulting in nil
, but it doesn’t seem to actually load the namespace (all of the symbols are still unresolved)
If I have a file, dev/user.clj
, and in my deps.edn I have {:paths ["src" "dev"]}
, after I jack-in the vars I define in the user namespace exist.
By default, tools.deps includes the "src" path, so if you have src/user.clj
that file will be loaded even if your deps.edn is just {}
So, you don't need to use a repl connect sequence, this is built in to tools.deps and I think leiningen. The file just needs to be on your classpath.
Doh! I hadn’t added src/dev
to my :extra-paths
key of the :dev
alias! Thanks for pointing this out, it’s working now!
I keep having trouble with shadow-cljs — I start my shadow app with: npx shadow-cljs watch frontend and connect to an existing repl and use the :frontend option — When I try to evaluate something I get: No available JS runtime.