Fork me on GitHub
Jack Arrington01:07:06

So, I tried to jack-in to an app project I made a few minutes ago with and I get this error:

Aborting. No valid shadow-cljs build selected.
Any ideas? I'm just now learning my way around the tooling so I'm not really sure how to go about fixing this.

Jack Arrington01:07:31

I know create-cljs-app is not very widely used, but it just bootstraps a simple app setup with shadow-cljs, reagent, and figwheel (here's so it seems like it would be compatible. To anyone who can point me in the right direction - thanks in advance!


From the error message it looks a bit like you are not selecting a build when prompted. Can you describe your steps to reproduce the problem?

Jack Arrington11:07:21

1. npx create-cljs-app some-app 2. cd some-app && npm run start 3. App should open in web browser 4. Open folder in VSCode, ctrl+alt+c. ctrl+alt+j to jack in. 5. Will prompt for project, select "app" 6. Gives the error

Jack Arrington11:07:05

Ah, I think I found the problem though. Need to use the "connect to running repl" option instead


Ah, now I see. It's the npm run start. Skip that and it should work.


You might need to open the app in the web browser yourself, though.

Jack Arrington11:07:06

Is there any advantage to using jack-in vs connecting to a running REPL? I'm doing that latter now and it seems to be working great so :man-shrugging:


With Jack-in Calva will provide its dependencies. w/o jack-in, you will need to provide that. So if Calva's requirements changes, things will not work until you update your project.

Jack Arrington11:07:29

> if Calva's requirements change I'm a total newb to this style of development, could you give an example of when this might happen?


It can and does happen at any time. Sometimes because we want to introduce a new feature, sometimes because we want to benefit from bug fixes upstream. And Calva will often seem to work anyway, just subtle bugs here and there. You can't believe how often we help people with these issues. (And I assume a lot of people never even solve them, because they don't ask us for help.) A lot of people keep their projects updated with Calva dependencies themselves, so it is not a no-go, by far. But for most people it is just an unnecessary source of error.

Jack Arrington12:07:36

Gotcha. I'll look into getting the jack-in working properly later. Thanks for your help!

metal 3

@U0174QDHXV3 On a similar note, for example, if you don't have cider-nrepl in your shadow-cljs.edn deps, and you start the repl without jackin, go-to definition will not work in the editor, because that depends on cider-nrepl, and calva injects that for shadow projects via jack-in.


This is somewhat noted in the shadow docs -> calva section though

👍 3
Maksim Glebov06:07:52

Unfortunately 2.0.111 is unusable for me =( The output window now opens automatically after loading vscode and .calva folder is automatically created (even before jack-in). Imo, this is super-frustrating: - Does not play well with multiple projects in a directory (eg. monorepo or VSCode workspace) and/or VSCode Remote Extensions. I ended up with two or more instances of .calva folder when opening project in different contexts (e.g. monorepo root and docker container root) and broken jack-in. - The output window is not needed if I only want to change readme file or docs. Closing it everytime is kind of annoying. I had to roll back to the previous version for now.


Previous, as in .110?


The changes in .111 are mostly to stablize the behaviour, so I can't really roll them back, but I might be able to avoid some off the effects making it bad for you there. Though I need to understand the problem better first...

Maksim Glebov07:07:20

Could it be that Calva is not able to reliably determine clojure project (leiningen) root before jack-in? For me this new behaviour is like an unexpected side-effect after opening vscode.

Maksim Glebov07:07:53

Noticed that Calva hangs on jack-in after removing .calva folder.


The project root thing is particularly stateful and brittle.


I wanted to avoid popping up Calva says, so moved some messaging about how to connect the REPL to the output window. Hence why it shows before jack-in. But maybe in some cases this won't work...


Can you file an issue describing your workflow briefly and how this new behaviour clashes with it? I'll start looking into what can be done about it.

Maksim Glebov07:07:32

Will do. Thank you!


I created the issue now. Needed the handle. 😃 Please feel free to amend to it. Especially if it looks like I have misinterpreted the issue.

Maksim Glebov09:07:30

No output window on startup, but jack-in does not work and .calva folder is not created... Will take a closer look a little bit later 🙂


OK. So I think I can reproduce it now. You get a ”Jack-in done.” in Calva says, but then nothing more happens?

Maksim Glebov10:07:32

Yes, that's right.


You are suffering because I've made this part of Calva so stateful. I will need to address that soon. But for now I think I have fixed it (by introducing even more state, haha).


Released it now. 😃 Betting on that my repro was right. Let me know if it still doesn't work for you.

🎉 3
Maksim Glebov16:07:22

Sorry for delay. It works now! Thank you!

metal 3

HI ! The shortcut alt+ctrl+c ctrl+alt+e stills showing the results on the "old" REPL screen. Is it the expected behaviour on 2.0.112 ?


Hello, @alefeans2. Yes, I guess that is expected behaviour as long as the old REPL window still exists. But, yeah, quite confusing. We should hurry up removing that window.

👍 3

Anyway, in most cases, @alefeans2, you can now save yourself some finger bending by just using ctrl+enter instead. 😃


Thanks for the quick answer ! I'm already using this one 🙂


Sometimes, we don't want the results to appear right next to the evaluated expression, but only on the REPL window. But I got it anyway and will wait for the next releases !


Press esc and the inline display is dismissed.


If the output window is visible, maybe we could skip displaying inline... @U9A1RLFNV, whatchasay?


:thinking_face: Would need to be careful here. I'm not sure most people would want to not have the inline display even if the output window is visible. I doubt it would hurt much though, could probably be easily reversed if we get complaints.


I would say we could add a setting, but I think I know you're response @pez 😂


And I don't completely disagree


I've already added a setting today. 😀


Why not have both options ? Display inline and display in the REPL window ? 😛


Two different shortcuts (like the past releases)


I think minimizing keyboard shortcuts where possible will save on user cognitive overhead and developer maintenance down the road. It's worth a try to minimize here


I'm thinking like this. When you evaluate a form, you are interested in the results. Wether they are printed inline or somewhere else is secondary. If the results window is visible, it is reasonable to assume that you will be looking there for the results. If it is not, it is reasonable to assume that you do not find it worth having the window taking up space. Then we show the results inline instead.


Makes sense to me


Dear Calva friends. Since we have removed the results display in the evaluation hover, and it showed to be a used feature, this PR build is introducing a new way to peek at the rich results: a definition hover. So if you install this VSIX - - you will be able to have a workflow like: 1. Evaluate a form. 2. See the first line of the results inline. 3. Press alt+f12 to get a peek widget showing the results as it is printed in the output window. It can look a bit like so:

❤️ 15

Ohh I’ll have a look, I like the preview window but missed the inline results. A question: can I make the evaluation result show below the code if the window is narrow? A lot of times I have to horizontally scroll to see the result.


You mean the inline eval results? If so, no. It's a css :before style applied to the last character in the evaluated form.


ah. that’s unfortunate. Couldn’t it be an actual “panel” inside the editor?


Like this: (this is from the github PR extension)


Pressing the little up arrow on the right dismisses the panel.


I feel like I sound demanding, so I will state it another way: would you be opposed to the inline results looking like this?


I haven’t done any Calva work despite mentioning a few times already, perhaps this time I will actually get around to setting up a Calva dev environment.


That looks super interesting! I wonder how that is done. Please feel encouraged to give it a shot.


And you do not sound demanding at all. I am super happy to see ideas about improvement floated around. The current inline display is far from what I would want them to be.


@pez I'm not seeing the behavior expected from peek definition based on the gif. possibly relevant: • installed vsix via command line and had to use --force since there was a newer version available • specific box tested on was windows 10 + lein project under wsl (can test on my linux box if this bit matters) • I use the vim extension I used the foo bar example code just in case, but I'm seeing this with everything. Hitting either the binding (alt f12 on this computer) or right clicking and getting to peek defintion just results in it showing the code definition only. I never see it bring up anything from the output file. Does my cursor need to be in a specific place for this to work properly? I was using alt enter to send the form.


@UH4NF3DHC, thanks for testing the VSIX! We've updated it a bit since I posted that link. Can you try the latest build and see if it behaves better?


It is now released, so you can use latest Calva. There's a mention in the docs too:


Please let me know if it keeps not working.


@pez in retrospect, the following might have been what was happening with the other version and I just didn't notice... For something like (parse-zone-code-line test-string), with my cursor on any character other than the opening parentheses, it wants to show me the definition of the parse function earlier in the file instead of the definition from output.repl-file. I'm still able to access the output definition but it takes 2 clicks (since it always seems to want to start with it folded (see arrow in the screenshot)): one click to expand the output.repl-file listing, another to click on the results. Same behavior in windows and linux. Vim extension on both. Is there any way for it to force preferring the output repl file definition? As it is now, I'd probably prefer to just adapt to learning the ctrl alt c o for the output window instead.


It might be possible to skip providing the symbol definition when there is an output one. Not sure that is very good though...


Might be extra useful for small screens when you have the output window in the same editor column as your source files.


@glebovmaksim You're using the output window like that, right?

Maksim Glebov21:07:52

Right! I'll play with it tomorrow (getting late here). Looks super interesting!

Maksim Glebov21:07:03

I think @UH4NF3DHC may also be interested in this.


FYI for anyone who may be in a similar situation, the shortcut could be different per distro, but the command is Peek Definition. On my linux distro the keybinding is ctrl+shift+F10.


Quite surprising that it would differ. Is go to definition on f10?


It's F10. Though, I just remembered I am using the VS code version/adaptation from the manjaro linux repository, because the snap was crashing on me sometimes.


So maybe this version has different keybindings more suitable for manjaro linux




@pez We should probably note that in the docs


Not necessarily that specific shortcut, but the command name and that it could be different per OS


Great job on implementing too!