Fork me on GitHub
#cursive
<
2020-04-06
>
dazld09:04:53

hey, I guess this is a common thing, but I'm getting the following error when trying to run a test via cursive on a shadow setup:

Error in phase :compilation
Calls to `require` must appear at the top-level. at line 1 cljs/user.cljs

cfleming09:04:12

Just checking, are you trying to use the Cursive test integration? That only works for Clojure at present.

dazld13:04:17

Correct, and thank you, that saved a lot of time.

dazld13:04:54

Hope this can be made to work for cljs sometime!

dazld09:04:01

I can't seem to track down what's causing this

dazld09:04:05

any hints?

dazld09:04:13

latest shadow, latest cursive

p-himik13:04:41

Is there a way to print exceptions in the REPL in such a way so that stacktrace items are turned into hyperlinks that direct you to the files within your project? I know that throw does that, but I would like to have something else.

p-himik05:04:30

@U0567Q30W Ping.

cfleming05:04:35

Most ways of printing exceptions should be hyperlinked, from .printStackTrace to clojure.stacktrace/print-stack-trace

cfleming05:04:51

As well as aviso/pretty, clj-stacktrace etc

p-himik05:04:37

Nice, thanks! The regular prn does not work or course, and I completely forgot about the built-in .printStackTrace.

cfleming05:04:43

Yes, I’m still not sure how best to hyperlink the datafied forms, because they’re not formatted consistently when output.

p-himik05:04:54

Where does the inconsistency come from? print-throwable seems to write the strings without any leeway.

cfleming05:04:23

Yes, that should work. But if you return an exception object, you’ll get the datafied form and that can vary (map items in unpredictable orders etc)

p-himik05:04:53

Ah, right, I see. So it's feasible to make (prn e) work but maybe not (prn (Throwable->map e)). Thanks.