Fork me on GitHub
#cursive
<
2021-10-27
>
onetom05:10:02

has the error formatting in the REPL window changed in the latest cursive? it has pretty colors and nicely indented now.

onetom05:10:37

or is this the consequence of something else customizing the exception reporting format?

cfleming05:10:43

That looks like Aviso pretty to me. Cursive will use it if you have it installed and loaded.

imre11:10:58

How exactly can this be used? I tried putting pretty on the classpath, then doing

(throw (ex-info "foo" {:bar 1} (Exception.)))
(pst)
but not getting this nicer display

onetom16:10:21

i ran ((requiring-resolve 'io.aviso.repl/install-pretty-exceptions)) - as mentioned here: https://ioavisopretty.readthedocs.io/en/latest/exceptions.html#io-aviso-repl - and then both (clojure.repl/pst) and the Print Last Exception Cursive action is printing nicely.

imre16:10:27

ooh so it isn't as simple as putting it on the classpath

onetom16:10:38

for me it was pulled in by midje, through nubank/matcher-combinators, because i forgot to exclude midje:

{nubank/matcher-combinators {:mvn/version "3.3.1"
                                :exclusions  [midje/midje]}
...
like this

onetom16:10:23

well, mr fleming did say: if u have it installed and loaded

imre16:10:54

yeah, I wasn't familiar with this lib at all

onetom17:10:08

i saw it ages ago, probably in https://github.com/bhauman/rebel-readline , but since it was pulling in a lot of deps, i ignored it, because cursive was already enhancing exception printing since then machines got more ram and more powerful cpus, so maybe it's not such a bad idea anymore to use this by default :)

cfleming23:10:56

Yeah, the namespace has to be loaded, since there’s no simple way to check if something is available on the classpath or not.

cfleming23:10:08

Cursive will also use clj-stacktrace if it’s loaded.

onetom01:10:32

i think these would be great selling points for Cursive. i would worth mentioning them on the website and include screenshots too. it could definitely help me to win some ppl over to Cursive.

cfleming01:10:14

Sounds good, I will do.

imre06:10:55

Just out of curiosity, wouldn't requiring-resolve be a simple enough way to chexk?

cfleming08:10:19

The problem is that if it's not on the classpath, then it'll search it every time an exception is printed. Perhaps that's not a big deal, but I assumed anyone wanting to use it would have loaded it somewhere.

onetom10:10:00

there must be some caching going on in requiring-resolve, because subsequent calls take almost no time:

(time (requiring-resolve 'io.aviso.repl/install-pretty-exceptions))
"Elapsed time: 157.880319 msecs"
=> #'io.aviso.repl/install-pretty-exceptions
(time (requiring-resolve 'io.aviso.repl/install-pretty-exceptions))
"Elapsed time: 0.037877 msecs"
=> #'io.aviso.repl/install-pretty-exceptions
(time (requiring-resolve 'io.aviso.repl/install-pretty-exceptions))
"Elapsed time: 0.032688 msecs"
=> #'io.aviso.repl/install-pretty-exceptions

cfleming23:10:57

Right, but that's if it's present on the classpath. I’m not sure how long that would take if it had to search for it but couldn't find it each time.

👍 1
onetom05:10:18

@cfleming You typically get negative feedback, so here is a positive one 🙂 I'm using 1.12.0-eap1-2021.3 on macOS Big Sur for 2 days now and I have no issues so far. I don't use tools.build yet though. Everything feels smoother and snappier on this latest IntelliJ EAP release compared to the latest non-EAP one. I really love the new map formatting logic too! We are one step closer to a uniform Emacs and Cursive code formatting experience!

💯 7
cfleming05:10:59

Great, thanks - I also love positive feedback 🙂 Great to hear it’s going well. I’m going to look more in-depth at formatting soon, that’s some of the oldest code in Cursive and it could do with a dust-off. As part of that I’m going to make cljfmt compatibility a priority.

❤️ 2
🙌 2
octahedrion09:10:06

people usually only give feedback when something's wrong I guess, well let me also say I'm delighted with Cursive & been using it since the start, good job @cfleming

👆 1
Ivar Refsdal10:11:20

I also totally dig Cursive! Great job @cfleming !

cfleming20:11:08

Thanks everyone!

dazld11:10:48

hey people - I'm trying to setup clj-kondo via the LSP method, but I don't seem to be able to see the reported issues from kondo in the IDE - what am I missing? hovering shows either the previously setup static issue, or documentation.

👀 1
dazld11:10:53

ie, I don't see the linting feedback. maybe this is better for #clj-kondo too 🙂

dazld11:10:46

answering my own question - the IDE was configured to not show errors, I had to go and change the options in the top right:

ericdallo12:10:37

BTW have you tried the LSP plugin with clojure-lsp? :)

dazld09:10:51

but clojure-lsp is excellent, and i've used that with emacs very succesfully (ty for that btw, eric!)

ericdallo12:10:28

Cool, you are welcome!

Otto Nascarella18:10:32

hey @UKFSJSM38… I have tried it yesterday, but the intellij lsp plugin dies quite quickly. if I try and use clj-kondo command line, it also dies. it needs to be the special server build provided by @U04V15CAJ

borkdude18:10:57

hmm, the difference is binary vs JVM there?

borkdude18:10:26

what do you mean by "it dies", can you give some example output?

Otto Nascarella18:10:52

it times out. even if I give it 60s to start

borkdude18:10:17

but you say on the command line it also dies?

Otto Nascarella18:10:25

no, no! sorry for the misunderstanding. it does not work in integration with the LSP plugin. even the normal standalone jar does not talk nicely to it. it needs to be the clj-kondo-lsp-server one

ericdallo18:10:34

the first time clojure-lsp starts, it can take one minute or 2 depending on the project

ericdallo18:10:40

the next times it caches

Otto Nascarella18:10:02

I’ll give it a huge bump and see…

Otto Nascarella18:10:01

> even the normal standalone jar does not talk nicely to it I mean… the lsp plug in does not talk nicely to lsp 🙂

Otto Nascarella19:10:50

although that message showed up, now it’s green @UKFSJSM38 and the highlighting I was getting from clj-kondo are also working ✌️

ericdallo19:10:35

that message means lein classpath or clojure -Spath failed, it depends of your project type