Fork me on GitHub
#calva
<
2021-06-11
>
vncz15:06:01

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?

bringe15:06:14

A believe a deps.edn file is required at the root of the opened project. CC @U0ETXRFEW

vncz15:06:40

That seems to be the case; I was wondering if there’s a workaround for this

bringe15:06:57

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

👍 2
pez22:06:02

Try having a Clojure file from the project opened when you Jack in.

vncz22:06:11

I tried that already, but it did not make any difference

vncz22:06:28

It’s not a big deal — I have essentially some openfaas functions and each of them has its own directory and deps.end file

pez09:06:17

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.

vncz13:06:21

Yes, I think I can try to make it happen!

bringe01:06:21

@U0ETXRFEW Should we update the docs to mention that?

pez05:06:52

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.

👍 2
bringe17:06:42

Made an issue to track it for later

cjsauer16:06:28

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?

Ryan Jerue19:06:45

You could specify with afterCLJReplJackInCode

Ryan Jerue19:06:09

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)"

Ryan Jerue19:06:23

Full object was…

{
            "name": "Leiningen Ex",
            "projectType": "Leiningen",
            "cljsType": "none",
            "afterCLJReplJackInCode": "(ns my-ns.core)",
            "menuSelections": {
                "leinAlias": null,
                "leinProfiles": [
                    "dev",
                    "repl",
                    "user"
                ]
            }
        }

cjsauer20:06:02

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)

bringe22:06:49

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.

bringe23:06:32

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 {}

bringe23:06:25

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.

cjsauer16:06:44

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!

bringe17:06:32

No problem!

tbrooke20:06:46

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.

bringe23:06:55

I'm guessing it's a browser app. Do you have the app loaded in the browser?

bringe23:06:50

If it's a browser app, the browser is used as the runtime, so it needs to be loaded in order for evaluations to work in the editor/repl.

bringe23:06:10

At least, I think I'm understanding that correctly 😄 . I've had a similar issue in the past when doing browser-based cljs dev.