Fork me on GitHub
#calva
<
2019-09-12
>
pez06:09:50

I now have created a subscription so that whenever the clojure and vscode tags are used in the same question, I’ll get notified in Telegram. That’ll be once a year, judging by the current activity on SO. 😃

😅 4
uknys11:09:56

Hello everyone, i'm thrilled to use this extension, but atm I can only use it if I open the repl in my msys2 env, is there a way to automate that with vscode ? without me having to use lein repl in my msys2 term ?

kstehn12:09:40

What os Do you Use?

uknys12:09:46

Windows 10

pez12:09:04

Have you found the Jack-in command?

uknys12:09:10

sure but it says it can't find lein command, I added lein path to Win Path but doesn't work out, it's not recognized as a program since it's a bash file

uknys12:09:58

but if I open lein repl in my msys2 terminal it works out

pez12:09:15

Which version of Calva are you using?

pez12:09:45

Have you restarted code since you installed lein.

uknys12:09:55

yes but he doesn't recognize lein

uknys12:09:11

since it's a bash script because I installed lein and clojure inside msys2

uknys12:09:23

Executing task: C:\Windows\system32\cmd.exe /d /c lein update-in :dependencies conj [nrepl"0.6.0"] -- update-in :dependencies conj [cider/piggieback"0.4.1"] -- update-in :dependencies conj [com.bhauman/figwheel-main"0.2.3"] -- update-in :plugins conj [cider/cider-nrepl"0.21.1"] -- update-in [:repl-options^ :nrepl-middleware] conj '["cider.nrepl/cider-middleware"]' -- update-in [:repl-options^ :nrepl-middleware] conj '["cider.piggieback/wrap-cljs-repl"]' -- with-profile +uberjar repl :headless < He does this task but is there a way to make it use bash (included with msys2) instead of cmd ? I think it would work this way

pez13:09:35

There is no such way today, unfortunately.

pez13:09:42

The wiki has some info on using remote and WSL. Not sure how relevant for your case, but anyway.

alex-eberts14:09:43

hi @pez some testing feedback from the latest pre-release build of Cava:

alex-eberts14:09:49

I tested with a project based on the re-frame template: https://github.com/Day8/re-frame-template

alex-eberts14:09:10

I tried using the Cava command Cava: Start a project REPL and Connect (aka Jack in) but the REPL window doesn't appear (I'm not very familiar with Cava or Visual Studio Code so maybe I'm looking in the wrong place).

alex-eberts14:09:39

The terminal window pops up and the code appears to be compiled correctly. The app is running and I'm able to visit the app url in the browser. Devtools in Chrome shows that shadow-cljs successfully created websocket and a REPL connections.

alex-eberts14:09:21

There's a message at the bottom of code: Launching a REPL using Leiningen and Disconnected

alex-eberts14:09:24

One thing to note is that this template uses both leiningen and shadow-cljs so that might be the source of the problem. The project.clj is setup with lein aliases that call shadow-cljs like this:

alex-eberts14:09:29

:aliases {"dev"  ["with-profile" "dev" "run" "-m" "shadow.cljs.devtools.cli" "watch" "app"]
            "prod" ["with-profile" "prod" "run" "-m" "shadow.cljs.devtools.cli" "release" "app"]}

alex-eberts14:09:56

Hope that helps - please let me know if you'd like more details.

pez15:09:19

@alex-eberts Thanks! This is exactly the kind of feedback we need. I'll fiddle around a bit with the template and see if I can figure out what is lacking.

pez15:09:21

And. Without having had a look, it seems like a good guess that it is the mix of leiningen and shadow that might trip the process up.

pez19:09:43

@alex-eberts, Checked it out now. I think it’ll be a bit of work to fix it properly. I’d appreciate if you could file an issue about this. Since it is a template that I presume is pretty popular, we’ll put it on high priority. That said, all is not lost. There is a quirky workaround to get the repl connected: 1. Jack in and choose project type *Leiningen* 2. Choose launch with alias *dev* 3. Skip picking a profile. 4. Wait for shadow to build the app. (Calva will not connect, because reasons). 5. Issue the command *Connec to a running REPL, and choose project type shadow-cljs* 6. Choose build :app**

pez19:09:46

Quirky, as advertised. 😃 Here’s a way to unquirk it some. Put this in workspace settings.json:

"calva.replConnectSequences": [
        {
            "name": "Leiningen start REPL",
            "projectType": "Leiningen",
            "cljsType": "shadow-cljs",
            "menuSelections": {
                "leinAlias": "dev",
                "leinProfiles": []
            }
        },
        {
            "name": "shadow-cljs Connect",
            "projectType": "shadow-cljs",
            "cljsType": "shadow-cljs",
        }
    ]
Then: 1. Jack in and choose *Leiningen start REPL* 2. Wait for shadow to build the app. (Calva will not connect, because reasons). 3. Connect to Running REPL and choose *shadow-cljs Connect*

pez19:09:41

¯\(ツ)

gerred19:09:27

@pez noticed an inconsistency and wanted to confirm (or see if it's configurable) before I file an issue.

gerred19:09:43

when I send the current form to the REPL to evaluate, my cursor stays where it is. when I send the current top level form to the REPL, my cursor moves into the REPL window. 🙂

gerred19:09:48

I don't want it to move into the REPL

gerred19:09:12

I guess they both do

gerred19:09:31

anyway, it would be nice to have a setting of "don't move cursor to the REPL".

pez19:09:00

Which version are you using, @gerred?

gerred19:09:19

2.0.36 with the nrepl upgrade

gerred19:09:22

prerelease 🙂

gerred19:09:37

idk lol I figure I should just cut builds for myself off of dev at this point haha.

pez19:09:26

It is totally strange, because @brandon.ringe fixed so that the cursor stays in the editor. But now that isn’t happening…

gerred19:09:47

are you seeing it too?

pez19:09:58

Yeah. On 2.0.35

pez19:09:11

I am right now trying to fix the horrible #302 bug, which is much worse.

gerred19:09:00

oh that's a fun one

pez19:09:50

I introduced it fixing another issue. Will probably just swap back the other bug for now. because not all bugs are created equal.

bringe20:09:37

@pez, @gerred Maybe there was a merge issue, the change I made is no longer in master

bringe20:09:27

https://github.com/BetterThanTomorrow/calva/pull/294/files <- my change was adding true for the preserveFocus? param (second, optional param) to openReplWindow

pez20:09:46

Indeed, I don’t know, but I must have merged it away… I am reinstalling it now. And making it even more consistent across commands.

💯 4
pez20:09:30

Also, I have fixed the bug with repl window ns being reset. Hopefully less noobish merge this time!

calva 4
pez20:09:43

Fixed in my branch for it, that is.

bringe21:09:39

@pez thanks for the fixes!

bringe21:09:45

Just saw the 302 fix/merge

pez21:09:42

Yeah: Calva 2.0.36 is out. Fixing that #302 bug and also again behaves with focus staying in editor like @brandon.ringe fixed it once.

❤️ 8
pez21:09:09

And it uses cider-nrepl 0.22.1, @gerred, mostly because @slack1038 was less hesitant than I was with that. 😃

alex-eberts21:09:22

@pez Thanks for getting back to me with the workaround - I will certainly file an issue by the end of the day today (PST). 😀👍

❤️ 4
pez21:09:16

Please include the workaround in the issue, once you have confirmed that it does work. 😃