Fork me on GitHub
#cursive
<
2021-08-25
>
jsyrjala06:08:53

How to limit output to Cursive repl? E.g I evaluate some thing that gets printed as several millions rows, taking a long time. Instead I'd like cursive to truncate the output to some reasonable amount.

AJ Jaro11:08:06

Can you assign the output to a def and then use first or whatever key access you need from there?

flowthing11:08:42

Depending on the type of thing you're printing, you can also try (set! *print-length* 1024).

jsyrjala04:08:04

(set! *print-length* 1024) seems to work

flowthing05:08:58

(Of course, you can tweak the precise value to your liking.)

AJ Jaro11:08:02

I've started using clj-kondo for linting in IntelliJ with cursive. One drawback, however, is that clj-kondo is probably never going to allow code navigation which is a huge tool that cursive has in it's kit. Would there ever be a day that cursive offers custom linting options for macros? I understand currently you can use resolve as but that's just not addressing all my macro concerns. A custom linting option would help bridge the gap for me in this use case. Or an alternative here is to define which macros you'd like to expand for processing

borkdude11:08:56

@ajarosinski FWIW, clojure-lsp builds on clj-kondo for navigation and uses the LSP protocol to implement navigation for clients that support it (emacs, vscode, etc). Not that this helps you with Cursive, unless you use some LSP plugin.

☝️ 3
3
borkdude11:08:39

If Colin is open to integrate clj-kondo into Cursive for those who want to use it, to allow custom linting for macros and possibly offer more linting that it provides, I'd be happy to help with that.

👌 3
👏 3
mike_ananev14:08:43

Is there any hotkey in Cursive+Idea to transform text in the editor like this: DOCKER_IMAGE_RELEASE_REPOSITORY -> docker-image-release-repository ? When I write scripts in babashka I need to deal with many env vars

imre14:08:34

afaik the 'string manipulation' plugin has stuff like these

mike_ananev14:08:06

@U08BJGV6E what is the name of plugin?

imre14:08:17

string manipulation

mike_ananev14:08:45

oh, I see. thank you!

popeye15:08:46

I have a list like below `

(def j `({:a "a" :b "b"})  )
How can I add the another key value in this so my output would be ({:a "a" :b "b" :c "c"})

popeye15:08:36

(cons {:c "c"} j)
is returning ({:c c} {:b b, :a a})

dpsutton15:08:25

was this meant for the #cursive channel?

popeye15:08:17

sorry , wrong group