Fork me on GitHub
#calva
<
2020-09-27
>
sogaiu00:09:27

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?

chucklehead01:09:26

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.

Clypto01:09:17

@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

borkdude18:09:15

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

victorb09:09:32

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

pez09:09:13

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.

victorb09:09:31

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
victorb09:09:23

@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

pez10:09:46

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.

victorb10:09:32

@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

victorb10:09:59

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

pez10:09:38

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

victorb10:09:09

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

victorb10:09:56

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

victorb10:09:26

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

victorb10:09:09

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

victorb10:09:06

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

pez13:09:40

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

pez13:09:19

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

victorb16:09:58

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

victorb16:09:24

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

👍 1
pez16:09:15

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.

victorb16:09:37

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