Fork me on GitHub

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.


Anyway, that's good to know. Thanks!


Do you know why the integration does not work?


Afraid not. It's this issue, I think: 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.


Yes, but there seems to be another issue that causes the same error message.


I believe I've narrowed it down to this bit in clj-kondo: But I don't yet know which file it is unsuccessfully trying to access.


Anyway, we'll try to figure it out. 🙂

👍 3

Please add your findings to the issue when/if you narrow it down more or find a solution. Thanks!


Yeah, we figured it out in the end. I'll add a comment in the issue about it.

👍 3

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
; 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 tests


is this a known issue or something? it’s similar to what was reported 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?


Nope, I haven't.


Tests are detected by the test metadata added to the vars, nothing else.


Thank you, will add the issue. thanks a lot


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


Also trying to send the current form doesn't do anything, not even the popup


Hm, looking at the bottom bar, the file seems to show "clj" while if I am in the repl window, it shows "cljc/cljs"


No idea what to do about that, though, and how does it decide it


It shows the repl as cljc/cljs no matter am I actually in clj or cljs


Can you describe the steps you take to start the repl?


If it is a public project, it would help with a link.


I launch the repl with the jack in, selecting deps and the :serve alias. From there run (shadow/repl :main) in the clj repl


Ok, I kinda managed to get it working, I think?


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


Now checked it quickly. I think it should work with a shadow-cljs jack-in.


We should write a guide (or two) about these shadow-cljs scenarious.


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 guess I have misunderstood the promotion, and I somehow need to tell calva about it?


Currently Calva needs to do the promotion in order to know about it.


Sure, yes… but what is promotion 🙂 ?


> 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.


Ok, so it's the same thing as without calva


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.


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


Heh, I'm tempted to check the source a bit 😉


Indeed. You are welcome to file an issue about it.


I will do at least that much!


> 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.


I can’t reconnect either when I try that. I’ll have a look at this during the weekend.


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

Hukka08:08:08 in case you use this slack thread to find all the info


Hello, I am using for showing diffs in the tests, cider already has a support for it. Can it be integrated with VSCode? found relevant issue here -


It should be possible. A PR would be welcome!


Alright, I will look into it


My bad, I think cider doesn’t support it, rather it has some with cider


Haha, well, if so I take my comment back. 😃


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?


There isn’t. The file is loaded before running the tests though.


Please file an issue about the behaviour you like to have.


Will do, thanks! Didn’t want to file a redundant issue 🙂


Please give this post, and the guide, some of your attention, Calva friends.


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" is an interesting read: "Curriculum · mhuebert/maria Wiki · GitHub"


I think easing the install story is super important.