Fork me on GitHub
#parinfer
<
2016-02-05
>
mfikes00:02:26

Using Parinfer to calculate indentation when entering ClojureScript forms in Planck: https://youtu.be/q4LmSC6xdsI

cfleming01:02:41

@mfikes: Looks very nice.

cfleming01:02:42

@chrisoakman has shamed me into implementing it in Cursive now by removing all my excuses simple_smile

mfikes01:02:32

Hah! It will be interesting to see how it works in Cursive. :) My use cases have been minimal in comparison to what must be going on in Cursive.

cfleming01:02:21

Yeah, it’s actually trickier than I thought, quite apart from the UI aspects of not making it terribly confusing.

shaunlebron01:02:48

I’m not seeing any inferred parens, so I’m guessing you did some magic here

mfikes01:02:25

@shaunlebron: It is only using it for calculating the indentation. (Really just a minor enhancement to Planck to automatically type the spaces at the beginning of each line for you.) I think if Planck gets multi-line editing, then full-on Parinfer is on the top of my list: https://github.com/mfikes/planck/issues/120

shaunlebron02:02:52

@mfikes: cool, I like the balancing with indent-mode and then paren-mode for retrieving indentation length https://github.com/mfikes/planck/commit/7303cf8e435335e5bb054b861271e7916b886baa#diff-13fa1297261809d0414872aca47177beR30

mfikes02:02:39

Hehe, yeah, not the expected use case for Parinfer at all :)

shaunlebron02:02:15

clever and useful though!

shaunlebron02:02:40

@cfleming what kind of problems are you having?

cfleming02:02:32

@shaunlebron: It’s internal IntelliJ stuff. I have to use a document listener to get the changes to the documents, but I can’t update the document inside that listener.

cfleming02:02:54

So I have to some up with some way to update the document later after some event that provokes a change.

cfleming02:02:39

There’s also the issue that Cursive/IntelliJ will update documents that are not open in an editor with refactorings or VCS operations.

cfleming02:02:52

I’m not sure whether I should do those too.

cfleming02:02:28

At the moment I’m working on some of the UI stuff to make this more obvious, then I’m going to try actually integrating it.

shaunlebron02:02:15

depending on intellij, you may have a problem making parinfer’s edits bypass the undo stack

shaunlebron02:02:25

if the parinfer edit gets added to the undo stack, undo will remove parinfer’s edit, but since parinfer runs after every edit, it will auto-redo the edit

shaunlebron02:02:31

if that makes sense

cfleming02:02:54

No, that won’t be a problem - I can update the doc without affecting the undo stack.

shaunlebron02:02:57

it was only a problem with Sublime Text, other editors were fine with it and didn’t require any extra work

shaunlebron02:02:25

alright, well good luck

cfleming02:02:33

Thanks, I’ll let you know how I get on.

cfleming02:02:40

How’s the new gig?

shaunlebron02:02:52

ha, everyone here is really smart

cfleming02:02:03

Why thank you.

shaunlebron02:02:07

it’s a whole nother world here from what I’m used to

cfleming02:02:14

Oh wait, you meant Stripe.

shaunlebron02:02:24

you too colin

cfleming02:02:28

Anyway, that’s cool. They seem like a great company.

cfleming02:02:31

Oh stop it.

cfleming02:02:53

Are you allowed to talk about what you’ll be doing, apart from infiltrating them with CLJS?

shaunlebron02:02:10

yeah, i got a little overwhelmed today, but great people and far-reaching technology

shaunlebron02:02:17

i’m working on the checkout form

shaunlebron02:02:54

they make all the new recruits get up during allhands to introduce themselves to the company

shaunlebron02:02:09

i made it clear that my secret mission was to bring clojure to stripe

shaunlebron02:02:16

so it’s not really a secret anymore

cfleming02:02:16

Excellent work.

cfleming02:02:49

It’s going to be interesting times for them with the new PCI changes.

shaunlebron02:02:50

seriously though, they’re open to new technology, and just want to add stuff incrementally in a way that doesn’t move us backwards

shaunlebron02:02:02

so we’ll see

cfleming02:02:08

They actually are just about to launch in NZ too.

shaunlebron02:02:09

not going in guns blazing

cfleming02:02:37

Anyway, I’ll let you go, I’m sure you’ve had a busy week simple_smile

cfleming02:02:48

I’ll let you know how I get on with this.

shaunlebron02:02:59

yeah, catch up later, good night