This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-19
Channels
- # announcements (15)
- # babashka (4)
- # beginners (55)
- # calva (92)
- # cider (70)
- # circleci (1)
- # clj-kondo (136)
- # cljdoc (2)
- # clojars (11)
- # clojure (48)
- # clojure-australia (1)
- # clojure-europe (30)
- # clojure-nl (3)
- # clojure-sweden (2)
- # clojure-uk (7)
- # clojurescript (40)
- # conjure (5)
- # core-async (11)
- # cursive (55)
- # data-science (1)
- # datomic (10)
- # degree9 (2)
- # development-containers (15)
- # events (1)
- # fulcro (14)
- # gratitude (13)
- # helix (5)
- # lsp (35)
- # malli (10)
- # meander (18)
- # off-topic (24)
- # pathom (13)
- # polylith (12)
- # practicalli (6)
- # re-frame (13)
- # reagent (33)
- # reitit (4)
- # remote-jobs (1)
- # shadow-cljs (13)
- # spacemacs (31)
- # specter (1)
- # stepwise (2)
- # tools-deps (19)
- # vim (1)
- # xtdb (7)
Trying to help a coworker with Calva. View » Go to Symbol in Editor yields "The active text editor does not provide symbol information", and View » Go to Symbol in Workspace yields "no matching workspace symbols". Is there any way to make them work with Clojure?
I tried with clojure and clojurescript and it should work. I am also using the “rename symbol” feature regularly which i guess uses the same data. Look in the “Output” tab if there any errors logged by Calva (or clujre-lsp)
Those should work. It is provided by #lsp . There is a setting calva.trace.server
that can enable verbose logging from clojure-lsp. Maybe you can see something there what is going wrong?
Oh, I didn't realize it's LSP-powered. I thought it was powered by syntax definitions. That explains it -- the LSP integration doesn't work on my coworker's machine.
Afraid not. It's this issue, I think: https://github.com/BetterThanTomorrow/calva/issues/1050#issuecomment-890701486 But the recent fix to clojure-lsp doesn't seem to have fixed it.
My best guess is that some corporate anti-virus or monitoring software is interfering with clj-kondo, but not sure.
Wow, that’s some thread! It looks from that conversation that that particular issue should be fixed, though. Maybe I read it too quickly.
I believe I've narrowed it down to this bit in clj-kondo: https://github.com/clj-kondo/clj-kondo/blob/b6f76ea8371d2497ed14314cf99a679e41f5db4f/src/clj_kondo/impl/core.clj#L337-L339 But I don't yet know which file it is unsuccessfully trying to access.
Please add your findings to the issue when/if you narrow it down more or find a solution. Thanks!
Hi, there we are facing a weird problem when running a single test in windows. If we ran a single test
; Evaluating file: reports_test.clj
#'edge.test.reports-test/sb-switches-report-test
; Running test: _…
; No tests found.
, ns: 0, vars: 0
but if we ran all the tests in the namespace the tests run. this is happening with all the testsis this a known issue or something? it’s similar to what was reported https://github.com/BetterThanTomorrow/calva/issues/1086 here, but in our case is happening even if we refer deftest
I don’t know how known it is, but I have certainly experienced that tests that I expect to run instead gives me that message. You can help it being more known by filing an issue. 😃 It might be that it is some known issue on cider-nrepl as well. Maybe @U051BLM8F have seen it?
When I try to evaluate a cljs file (with the repl running the shadowcljs repl already) I just get a popup with something like "calva.loadFile failed"
Unfortunately google doesn't really give anything for that error, nor much more for using calva with cljs
Hm, looking at the bottom bar, the file seems to show "clj" while if I am in the repl window, it shows "cljc/cljs"
I launch the repl with the jack in, selecting deps and the :serve alias. From there run (shadow/repl :main)
in the clj repl
So I had jacked in, and while the repl window worked, I couldn't run anything from the file. But I ran "Connect to a repl ctrl-alt-c c-a-c" and chose the shadow repl this time, and it started working
Try jacking in using the shadow-cljs option directly too. Not sure it will work, it depends on the project (which I will check when I have freed up som time).
Jacking in as shadow-cljs does not work, I tried that at first. Sorry for not mentioning
It's trying to run the shadow repl with npx, and the project just isn't set up like that I guess
So the working process seems to be 1. Jack in to the deps.edn repl 2. Restart the connection setting the type to shadow-cljs
But I don't really see why calva refuses to send any forms/sexps from the editor to the repl without 2
Or fails perhaps, not refuses. Nothing just happens for single sexps, and evaluating the whole file gives that error popup
Oh, and also, I didn't find the documentation for this at first. I was looking for it at "Using calva with X", with X being clojurescript or shadow-cljs. Only now I was reading the "In Depth", though it's not really much help for this problem ;/
> 1. A Clojure nREPL connection needs to be established. We've covered that above. Calva makes an nREPL session clone to use for the ClojureScript REPL and then:
> 2. Your ClojureScript app needs to be compiled.
> 3. Your ClojureScript app needs to be started.
> 4. The Clojure nREPL session needs to be promoted to a ClojureScript nREPL session. (This is what piggieback helps with.)
is what I thought I did when I jacked in to deps.edn repl and ran the (shadow/repl :main)
> It’s trying to run the shadow repl with npx, and the project just isn’t set up like that I guess Hmmm…. I must have a look now. 😃
> I was looking for it at “Using calva with X”, with X being clojurescript or shadow-cljs Yeah, this is lacking. And what I was referring to as “write a guide (or two)“.
I thought it means I need to run whatever needs to be run in the CLJ repl, to move it to the CLJS mode
> to move it to the CLJS mode This is promotion. 😃 Not sure that is a good term for it, but anyway. We say that we promote the CLJ repl session to a CLJS one.
But how do I then let Calva do it, if doing by hand in calva's repl window doesn't help?
Oh, and when the focus is in the repl window, the bottom bar show s the repl type as cljc/cljs. But when I move the focus to the file, it's clj. But after I do the reconnect, then the file side also shows it as cljs
So it kinda gives the impression that there is a cljs repl, but it thinks the file is not cljs, and thus refuses to send the forms to the repl? I have no idea really, just speculating
You are probably speculating correctly. Part of the complexity here is that this is a bit bug ridden.
> But how do I then let Calva do it, if doing by hand in calva’s repl window doesn’t help? It’s done as part of the connect. Which is why your workaround works.
We might be able to use a REPL Jack-in/Connect Sequence for this. https://calva.io/connect-sequences/
So is there some kind of logic, that Calva tries to track are files and repls clj or cljs, and doesn't let them cross?
I guess so you could run commands from both kinds of files at the same time, without fiddling with the repl manually?
For clj files the clj repl session is used. From cljs files the cljs repl. When you have a cljc file you might want to use either, so that indicator is also button that lets you switch which repl is backing the file. And the REPL window is treated as a cljc file.
That’s the intention. But there are bugs, And especially so if the jack-in/connect is not happening correctly.
Ok. The feature makes sense. Just odd that based on the bottom bar, the repl is actually categorized correctly, but the file is not
But yeah, bugs can manifest in surprising ways (cause if it wasn't surprising, why would it be allowed to happen)
I would suggest that the documentation re cljs would start by explaining this end goal / feature! I was expecting actually that calva would just send the forms to the repl, and it's my responsibility (though calva might help) to have a proper repl ready for them
But yeah. I have it working now, I understand what it's trying to do. Changing docs and fixing bugs is then a separate issue. At least for this case there's a handy repo that doesn't work smoothly, when it's time to work on it
> I was expecting actually that calva would just send the forms to the repl, and it’s my responsibility (though calva might help) to have a proper repl ready for them
I think that using a custom connect sequence you can trick Calva into doing this (something like using (println "foo")
as connect command and foo
as isConnected regex. This might fool Calva that it has a cljs session, which you can then promote manually.
Hm, I'll consider it, but for now seems like a more difficult workaround than reconntecing
I’m not really suggesting to do that, but it tells that this “manual” cljs setting should be reasonably straight-forward to include by default.
Thanks. Redoing everything for the issue, I noticed that things have either changed or I just didn't remember: The repl type in the repl after jack in is cljc/clj and in the file clj, but it still won't evaluate
https://github.com/BetterThanTomorrow/calva/issues/1270 in case you use this slack thread to find all the info
Hello, I am using https://github.com/venantius/ultra for showing diffs in the tests, cider already has a support for it. Can it be integrated with VSCode? found relevant issue here - https://github.com/BetterThanTomorrow/calva/issues/1007.
My bad, I think cider doesn’t support it, rather it has some https://github.com/venantius/ultra/issues/79 with cider
That's a common problem with plugin-style things that modify how clojure.test
reports failures -- they don't work together. I think both Leiningen and CIDER already mess with clojure.test
-- I know Paul Stadig's Humane Test Output has problems when run in those contexts (I use HTO because I do not use CIDER or Leiningen!).
I've seen quite a few reports of Ultra causing other problems by interacting badly with tooling. It's very... opinionated... For a while it was popular enough and causing enough problems for beginners that I started warning people to stop using it unless they really understood their toolchain 😐
right, I really miss the test diff functionality in VSCode though, I have to mostly use ultra for getting exact diff while comparing big nested objects
I just took a look through the calva settings and didn’t see an option: is there a way to run the refresh changed namespaces
command automatically when running tests?
Yes, we should tap into knowledge collected about these things. @U09LZR36F is putting me into contact with a guy who has studied how people learn and about teaching ans stuff and he is eager to leverage this for helping people learn Clojure. I have no idea what could come out of that contact, but am stoked to find out!
Also, generally, I think people learn in very different ways. So covering a lot of bases is probably a good idea.
The pedagogy of "Maria" https://www.maria.cloud is an interesting read: "Curriculum · mhuebert/maria Wiki · GitHub" https://github.com/mhuebert/maria/wiki/Curriculum