This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # babashka (44)
- # beginners (29)
- # calva (80)
- # cider (11)
- # clara (1)
- # clj-kondo (9)
- # clojure (80)
- # clojure-europe (21)
- # clojure-france (13)
- # clojure-nl (4)
- # clojure-spec (3)
- # clojure-uk (6)
- # clojurescript (72)
- # code-reviews (43)
- # crux (30)
- # cursive (11)
- # datomic (27)
- # events (13)
- # figwheel-main (12)
- # fulcro (27)
- # graalvm (1)
- # jackdaw (2)
- # kaocha (1)
- # malli (4)
- # meander (13)
- # nrepl (2)
- # pathom (8)
- # re-frame (4)
- # reagent (7)
- # reitit (9)
- # remote-jobs (1)
- # reveal (56)
- # ring-swagger (2)
- # sci (5)
- # shadow-cljs (20)
- # slack-help (2)
- # tools-deps (96)
- # vim (7)
So, I tried to jack-in to an app project I made a few minutes ago with https://github.com/filipesilva/create-cljs-app and I get this error:
Any ideas? I'm just now learning my way around the tooling so I'm not really sure how to go about fixing this.
Aborting. No valid shadow-cljs build selected.
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 https://github.com/filipesilva/create-cljs-app/tree/master/template) 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?
npx create-cljs-app some-app
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
Ah, I think I found the problem though. Need to use the "connect to running repl" option instead
Jack-in should work. Maybe you run into issue 707. Can you try with this VSIX? https://6916-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.112-707-open-output-when-connect-1b5f23f1.vsix
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.
> 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.
Gotcha. I'll look into getting the jack-in working properly later. Thanks for your help!
@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.
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.
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...
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.
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.
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.
@glebovmaksim this build should behave better: https://6911-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.112-707-open-output-when-connect-8b5a99b3.vsix , can you try?
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?
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.
HI ! The shortcut
alt+ctrl+c ctrl+alt+e stills showing the results on the "old" REPL screen. Is it the expected behaviour on
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.
Anyway, in most cases, @alefeans2, you can now save yourself some finger bending by just using
ctrl+enter instead. 😃
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 !
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 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.
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 - https://6946-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.113-693-result-definition-hover-1e9fd78d.vsix - you will be able to have a workflow like:
1. Evaluate a form.
2. See the first line of the results inline.
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:
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.
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? https://7099-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.115-693-result-definition-hover-6b176352.vsix
It is now released, so you can use latest Calva. There's a mention in the docs too: https://calva.io/output/#peek-at-results
@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.
Right! I'll play with it tomorrow (getting late here). Looks super interesting!
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
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.
Not necessarily that specific shortcut, but the command name and that it could be different per OS