Fork me on GitHub
#cursive
<
2017-09-21
>
pbaille06:09:05

Hello, i've got a macro that is a thin wrapper around fn, but in the 'resolve as' menu I can't find fn. How can I do?

cfleming08:09:30

@pbaille So I still haven’t fixed this so you can enter arbitrary vars to resolve as, sorry. There’s a workaround you can use by hacking config files here: https://github.com/cursive-ide/cursive/issues/1440#issuecomment-232776904

cfleming08:09:37

It’s a bit ugly sorry.

pbaille09:09:23

@cfleming thank you I will try this

pbaille09:09:58

@cfleming by the way, have you got an idea when the standalone version of cursive will be available?

cfleming09:09:12

@pbaille Not really, the install process is pretty easy these days so it’s less compelling.

cfleming09:09:31

I do still want to do it but it’s a lower priority than it was. Do you have a case where it would be useful?

pbaille09:09:48

no i was just wondering 🙂

cfleming09:09:17

Ok - I do want to do it, in particular a simpler version (or a version that could easily be configured to be simpler) for educational purposes is a use case I’d like to support.

cfleming09:09:27

Something more like DrRacket

cfleming09:09:57

Keybindings have also been an awkward part of setup but should be much easier in the next release.

pbaille09:09:09

ok I see, Personally I find cursive pretty simple to setup these days.

cfleming09:09:09

Yeah, that’s mainly why I’ve de-prioritised the standalone version. It’s a complicated thing to set up that is not at all documented by JetBrains, and it’s unclear how a non-JetBrains standalone would update itself etc.

pbaille09:09:54

I've got another question: I'm wondering why repl evaluated forms doesn't print the same that when wrapped in a 'println' call, specifically \newline chars looks to be omitted

pbaille09:09:30

i've noticed that print-method is called with a stringwriter instead of a printwriter when I send an expr to the cursive repl

cfleming09:09:08

Umm, I’m not sure why that would be the case. Cursive doesn’t mess with how print-method etc work, but since Cursive parses + pretty-prints the output on the client side, the results are sometimes different from what you might expect.

cfleming09:09:25

If you have a concrete example of something unexpected I can take a look at it.

pbaille09:09:30

i cannot see newlines when I evaluate this

pbaille09:09:40

this is really a dummy exemple

cfleming09:09:45

Here’s what’s happening.

cfleming09:09:29

nREPL just returns eval values back to the client as pr-str‘ed strings.

pbaille09:09:25

and it works in this case:

cfleming09:09:30

Cursive, in order to pretty print them, will try to parse them as Clojure data structures and then print the parsed version using fipp. What’s happening in your case is your output is correctly parsed as a form and then pprinted, but it all fits on one line so that’s how it’s printed.

pbaille09:09:00

it treat it as a list

pbaille09:09:06

in the first case

cfleming09:09:52

You can disable that if you like in Settings-&gt;Languages &amp; Frameworks-&gt;Clojure-&gt;Pretty print REPL return values

pbaille09:09:06

I like the pretty colors 🙂

cfleming09:09:15

But then none of your results will be formatted unless you install a middleware or something.

pbaille09:09:15

I don't want to remove it

cfleming09:09:42

In your second example, the newlines are preserved because you essentially have 3 top level forms.

pbaille09:09:47

maybe I can extend some fipp stuff?

cfleming09:09:22

So unfortunately it’s not extensible at the moment, because it’s built in to Cursive. I’m planning to allow it to be extended, but I’m not sure how that will work yet.

pbaille09:09:38

okok I see

pbaille09:09:10

thank you!

pbaille09:09:06

and if I disable pretty print repl, can I insert fipp myself as a nrepl middleware?

pbaille09:09:24

if it makes sense 🙂

cfleming09:09:16

Yes, you can - I think https://github.com/greglook/whidbey is what you want.

cfleming09:09:35

I believe there’s something similar which just uses pprint, too.

pbaille09:09:51

ok that's great, I will look at this

pbaille09:09:57

thank you a lot

cfleming09:09:27

No problem, let me know if you run into trouble - I’m not sure many people are using whidbey with Cursive, so I’d be interested to know how it goes.

pbaille09:09:39

ok I will tell you

pbaille10:09:02

I've just tried, I can't make it works. I've added whidbey stuff in my profiles.clj. It works as intended when used at the terminal with 'lein repl'. but doesn't works in cursive repl (i've unchecked Pretty print REPL return values). Also i've tried to check whidbey in profiles (lein intellij panel) but nothing seems to do the trick.

cfleming10:09:51

@pbaille Hmm, ok - I’ll take a look at that tomorrow. Could you file an issue to remind me?

souenzzo13:09:25

@cfleming double shift search find my project/my_namespace but not project.my-namespace... It's a know bug?

cfleming23:09:59

@souenzzo Sort of - unfortunately the double shift search isn’t extensible. So the only way I can contribute to it is to use symbols, which isn’t great for namespaces.

cfleming23:09:29

That means namespaces will also show up in the Find symbol… search, which you almost certainly don’t want.

cfleming23:09:13

Actually, looking at it, IntelliJ does actually add classes to the Find symbol… dialog. So perhaps I should add namespaces there too.

cfleming23:09:26

@souenzzo Could you file an issue for that and I’ll add them there?

cfleming23:09:03

I guess that means that keywords should probably go there too