Fork me on GitHub
#cursive
<
2016-04-18
>
cfleming22:04:05

@lsenta: It’s a bit more complex than that unfortunately. I could probably plug into autocomplete, but that’s far from a complete solution. You also need navigation, doc, view source etc - it’s all doable from the REPL but it’s a totally different implementation from what’s there. Many things are more difficult and having two implementations would be a source of many bugs.

cfleming22:04:28

I’ll have some improvements for this soon using the current model.

danielcompton22:04:22

I just had the weirdest bug, Cursive moved around a bunch of ] and ) all over the place

cfleming22:04:34

@danielcompton: Are you in parinfer mode?

danielcompton22:04:41

I think I toggled through it

cfleming22:04:14

Hmm, I hadn’t considered that.

danielcompton22:04:46

Why would it change anything?

cfleming22:04:48

So when you enter parinfer mode, it has to run paren mode to ensure that the indentation is within the limits required by indent mode.

cfleming22:04:35

I had assumed that anyone entering parinfer mode had explicitly chosen it, but of course toggling through it will trigger that.

danielcompton22:04:49

but why would it mess up my ] and )?

cfleming22:04:53

It shouldn’t have actually broken anything.

danielcompton22:04:56

It created invalid code

cfleming22:04:16

Can you show a diff of an example?

danielcompton22:04:40

I’ll try to reproduce it

danielcompton22:04:47

I have a fancy diff tool which doesn’t show the +/- so a screenshot is better

cfleming22:04:15

So in that case, the indentation causes the parens to move to invalid locations. I’ll have to check if parinfer handles that case (multi-arity fns) - IIRC there was something in their issue tracker about that.

cfleming22:04:24

In any case, sorry 😞

cfleming22:04:54

I’m starting to think that indentation is too fragile in Clojure code for a global mode that assumes it.

cfleming22:04:48

It looks like the parinfer demo editor handles that case, I must have a bug in the integration.

danielcompton22:04:34

There were quite a few things broken

danielcompton23:04:17

I think it’s more general than just multi arity functions

cfleming23:04:34

Right, but in that case it hasn’t broken code, right? It’s just pulled the parens over the comments.

cfleming23:04:00

(which I agree is bad, but that is a known issue with parinfer)

danielcompton23:04:39

ah yeah, that’s not a good example