calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
2020-09-27T00:52:27.041300Z

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: https://github.com/thheller/shadow-cljs/blob/master/doc/remote.md). 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?

chucklehead 2020-09-27T01:22:26.043300Z

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.

Clypto 2020-09-27T01:54:17.044100Z

@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

borkdude 2020-09-27T18:49:15.052700Z

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

victorb 2020-09-27T09:48:32.045700Z

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

pez 2020-09-27T09:51:13.048100Z

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.

victorb 2020-09-27T09:52:31.048200Z

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! šŸ™

šŸ¤˜ 1
victorb 2020-09-27T09:55:23.048500Z

@pez 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

pez 2020-09-27T10:00:46.048800Z

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.

victorb 2020-09-27T10:05:32.049Z

@pez 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

victorb 2020-09-27T10:05:59.049400Z

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

pez 2020-09-27T10:06:38.049600Z

You also need some amount of luck to actually find useful stuff there. ĀÆ\(惄)/ĀÆ

victorb 2020-09-27T10:07:09.049800Z

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

victorb 2020-09-27T10:18:56.050Z

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 "127.0.0.1"
                              :port 47326
                              :handler (nrepl-handler))))

victorb 2020-09-27T10:33:26.050400Z

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

victorb 2020-09-27T10:35:33.050600Z

yeah, hit some errors apparently, https://gist.github.com/victorb/1139cba5491f0c9ac268c0c5f7872a0a

victorb 2020-09-27T10:47:09.050800Z

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 https://imgur.com/a/fECviR6

victorb 2020-09-27T10:51:06.051100Z

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

pez 2020-09-27T13:44:40.051300Z

It might be that Calva lacks something to be able to work in that setup. Does this help any? https://calva.io/remote-development/

pez 2020-09-27T13:46:19.051600Z

FYI. The ā€Iā€ in that text, isn't me. I just copied the wiki text. šŸ˜ƒ

victorb 2020-09-27T16:03:58.051800Z

thanks for the link @pez, 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

victorb 2020-09-27T16:04:24.052Z

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

šŸ‘ 1
pez 2020-09-27T16:08:15.052300Z

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.

victorb 2020-09-27T16:08:37.052500Z

Yup, will do. Thanks again for all the help, and for Calva itself šŸ™‚