Fork me on GitHub

re: scrolling of output and test output -- i have struggled with what to do about test output and one's editor. i ended up punting with trying to do that sort of thing in the editor and went for running things from a terminal. i like the "log" nature of repl output, but definitely find that it's easy to get lost when the output is "big" (cf. the "print" problem mentioned by thheller here: in general, it seems that when values are output to a single buffer (or terminal) a single large value is enough to make earlier parts of one's "log" very difficult to reach ergonomically. that value can act as a sort of "wall". atm i think it's difficult to do something within the confines of one's editor panes (especially in an editor like vscode). handling larger values seems like it's good for things like rebl, punk, reveal, portal, or shadow-cljs' inspect ui. i don't have any good ideas yet about test output though. has anyone given that any thought?


I played around manually with attaching to Portal from a Webview in a VSCode pane, which works okay. Integrating that with Calva (where say REPL output also gets tap>ed to the Portal pane) might be interesting.


@borkdude thanks, I do think there is a bunch of :refer :all out there in the wild, many a tutorial or example code out there has it, and over time leaks into projects


Hmm, the issue I mentioned is different. Repro for your issue still welcome.


Hello everyone! Trying to figure out what I'm missing to get the "Go to definition" to work with my remote nrepl instance. I'm running nrepl server on a external server, have a tunnel setup via ssh to the server over the port. I got the connection and eval to work, but seems "Go to definition" and related functionality doesn't work, and I'm not sure what I'm looking for to get it to work


Hi there, @victorbjelkholm429! My guess is that the nrepl server does not meet the dependency requirements that Calva needs. Try starting the repl using Calva Jack-in and see what dependencies Calva injects on the command line (it is printed in the integrated Terminal). Then make sure youre remote nrepl server has those same dependencies.


Ah, yeah, as soon as I wrote the message I started seeing GitHub issues about not having the right dependencies. Cheers, I'll give that a try! 🙏

metal 1

@U0ETXRFEW I'm relatively new to developing on windows with visual studio code (coming from vim+arch linux), is there any location where calva stores logs/errors that I can access? Good to know for the future


It depends a bit. For the errors thrown in the main app thread, those go the the ouput/repl window. Some errors might go to the terminal starting the app. If Calva errors it can be examined in the VS Code Dev Console.


@U0ETXRFEW no, I was thinking specifically about Calva logs/errors, in order to debug things if things don't work as I expect, in order to troubleshoot


ah, sorry, yes, VS Code Dev Console was what I was looking for. Thanks! :thumbsup:


You also need some amount of luck to actually find useful stuff there. ¯\(ツ)


hah, nothing that some sheer brute force cannot deal with!


Update: managed to get it to work. Tricky part was trying to figure out how to inject middlewares when using the embedded nrepl server (instead of the stuff leiningen provides for example). Ended up with this (might be useful to add to the docs?):

(defonce repl-instance (atom nil))

(defn nrepl-handler []
  (require 'cider.nrepl)
  (ns-resolve 'cider.nrepl 'cider-nrepl-handler))

(defn start-nrepl-server! []
  (reset! repl-instance
          (nrepl/start-server :bind ""
                              :port 47326
                              :handler (nrepl-handler))))


Actually, the "Go to definition" doesn't seem to open the right file when I'm using it with my remote nrepl, it reopens the same file but I guess it's using the server location, rather than local location


Hm, managed to crash calva completely (and now I get "calva.command not found") by restart vs code and reopen with a .clj selected (found some old messages mentioning that as a possible workaround). Then selected "Connect repl outside of working directory" -> "Generic" -> crash


(sorry for the spam) seems like the path that gets returned somewhere gets wrangled, seeing the error Unable to open 'core.clj': Unable to resolve resource c:%5CUsers%5Cvictor%5Cinstant-website%5Csrc%5Cinstant_website%5Ccore.clj.


It might be that Calva lacks something to be able to work in that setup. Does this help any?


FYI. The ”I” in that text, isn't me. I just copied the wiki text. 😃


thanks for the link @U0ETXRFEW, unfortunately it seems focused on "Remote Development" extension which seems to be some sort of binary blob, rather not run that 😕 I ended up just opening up a VNC connection to my computer instead of trying to get VS Code to work my way


I'll give VS Code / Calva another try when I have more time available

👍 1

If you find the time, I'd appreciate an issue where you summarize what you tried to do and how it didn't work. It might be easy to fix and not so easy to fix, but would be nice to have on the radar.


Yup, will do. Thanks again for all the help, and for Calva itself 🙂