parinfer

shaunlebron 2017-08-25T01:10:30.000057Z

just finished my second week working on something for the new page that just didn’t work out

shaunlebron 2017-08-25T01:12:43.000210Z

i setup codemirror to transition the characters that were being shifted by parinfer, as a means to better illustrate the new things, but seeing it actually moving around is more noisy than it is clarifying, which is a bummer

shaunlebron 2017-08-25T01:15:34.000046Z

interestingly, I think the indent guides (vertical bars below open-parens of multi-line expressions) just better illustrate what is happening without adding noise

shaunlebron 2017-08-25T01:16:12.000176Z

i’m gonna gather my thoughts on it this weekend as we flee the hurricane!

shaunlebron 2017-08-25T01:36:53.000077Z

also, my conj talk on all this stuff was accepted, so I’ll be preparing material for that

1👍1🎉
cfleming 2017-08-25T06:47:12.000139Z

@shaunlebron Congrats!

cfleming 2017-08-25T06:48:01.000036Z

I have v3 working in Cursive with the indentation problem marking, but I’m just working through a couple of bugs before a test release.

cfleming 2017-08-25T06:52:05.000096Z

Once that is fixed I’ll add the top-level-form improvement. I already have the code written to return the information, I just need to allow running parinfer over a partial section of a file.

shaunlebron 2017-08-25T08:04:19.000287Z

@cfleming: I’m returning a parens tree which can be used to find top-level expressions

cfleming 2017-08-25T08:05:03.000308Z

Right, I’m actually not returning that in my version - I could have used that.

cfleming 2017-08-25T08:05:28.000071Z

I trimmed out most of the things I’m not using to make porting faster, I’ll add them back in when I update the official parinfer-kt

cfleming 2017-08-25T08:05:44.000055Z

At the time I didn’t think I’d be doing the top level form thing.

shaunlebron 2017-08-25T08:06:08.000315Z

makes sense!

cfleming 2017-08-25T08:06:32.000012Z

But it’s also trivial to return that info from onOpenParen and onBalancedCloseParen, and as a bonus I can record while scanning which of them are balanced.

shaunlebron 2017-08-25T08:07:08.000344Z

yeah, they’re also helpful for drawing indent guides correctly

cfleming 2017-08-25T08:07:23.000195Z

Right, IntelliJ actually draws those automatically anyway.

cfleming 2017-08-25T08:07:31.000164Z

They’re really nice for Clojure.

shaunlebron 2017-08-25T08:08:05.000267Z

I actually published 3.11.0 tonight with some parens tree fixes since I noticed some problems when testing them in CodeMirror before adding them to Atom

shaunlebron 2017-08-25T08:08:22.000329Z

(testing indent guides I mean)

cfleming 2017-08-25T08:08:50.000265Z

Ok, I’ll check out those changes.

cfleming 2017-08-25T08:09:08.000172Z

I have one last bug to squash, but I think it’s a bug in my integration, not in parinfer itself.

cfleming 2017-08-25T08:10:04.000318Z

But I think the integration in Cursive is really nice now, it’s a huge improvement.

cfleming 2017-08-25T08:10:26.000266Z

I need to work on cut and paste, which has always been a problem.

cfleming 2017-08-25T08:10:49.000214Z

IntelliJ tries to be smart about indenting pasted code, and it interacts badly with parinfer.

cfleming 2017-08-25T08:14:44.000129Z

Looks nice!

shaunlebron 2017-08-25T08:15:16.000127Z

it’s on now in the demo editor: http://shaunlebron.github.io/parinfer/demo

cfleming 2017-08-25T08:15:33.000074Z

BTW what do you use to record gifs?

shaunlebron 2017-08-25T08:15:51.000136Z

thanks! i think i’m convinced that tab stops are crucial for understanding what parinfer is doing now

shaunlebron 2017-08-25T08:16:29.000318Z

oh, i’ve been recording screencasts with ScreenFlow on mac for a while

cfleming 2017-08-25T08:17:17.000346Z

And that converts to gif?

shaunlebron 2017-08-25T08:17:25.000034Z

yeah, it exports

shaunlebron 2017-08-25T08:17:35.000026Z

I used to just use quicktime video recorder and upload to gfycat

cfleming 2017-08-25T08:17:39.000188Z

Cool, I’ll check it out.

cfleming 2017-08-25T08:18:12.000068Z

I’m pretty convinced that marking the incorrect indentation and letting the user fix it is the right approach, BTW. I’ll be interested to see what you think when I have it ready to try.

shaunlebron 2017-08-25T08:18:48.000060Z

i’m pretty excited about it too, looking forward to digging into it

cfleming 2017-08-25T08:19:23.000153Z

When I record the incorrect indentation, I also know what paren mode would correct it to, so hopefully I can show that somehow (perhaps a light green marker up to the right point then a red one after that or something)

cfleming 2017-08-25T08:19:41.000349Z

To guide the user to do the right thing.

shaunlebron 2017-08-25T08:20:17.000104Z

yeah, interesting

shaunlebron 2017-08-25T08:20:51.000137Z

does cursive add indent guides under maps and vectors?

shaunlebron 2017-08-25T08:22:32.000299Z

oh, and if you’re using forceBalance off in cursive, you’ll want to pull in the 3.11.0 change which fixes an annoying problem I’ve been seeing in atom

shaunlebron 2017-08-25T08:23:28.000397Z

(i.e. unmatched close-parens are now removed when in a leading paren trail, if that makes sense)

shaunlebron 2017-08-25T08:23:59.000074Z

I’m up too late, catch up soon!

cfleming 2017-08-25T08:33:23.000051Z

Ok, I’ll check it out, thanks!

rgdelato 2017-08-25T17:55:26.000119Z

@seancorfield Hopefully Parinfer v3 should mean that you won't have to switch modes anymore. If you have the latest Parinfer in Atom, maybe turning on "Smart Mode" in the package settings can fix some of your issues? My understanding is that the Atom Parinfer plugin will be switched over to v3 "Smart Mode" by default once the kinks are worked out.

seancorfield 2017-08-25T18:16:18.000023Z

Ah, I'd shied away from that because it was marked "Experimental" but I'll give it a go today -- thanks @rgdelato !

dominicm 2017-08-25T21:58:36.000262Z

@ashnur I just fixed the other clojure plugin that's designed the same way. Steps I took:

rm -rf ~/.config/nvim/plugged/node-host
Then this is my plugin config:
Plug 'neovim/node-host', {'commit': 'c1c4872a6a6837f333d8470185e0ea0f10256e3c', 'do': 'npm install'}
Plug 'clojure-vim/clj-refactor.nvim', {'do': ':UpdateRemotePlugins'}
Then I did
:PlugInstall
:UpdateRemotePlugins
:q
and now the stuff is working again.

1👏
dominicm 2017-08-25T21:59:52.000072Z

Looks like node-client made some major api changes, that forces a dependency on babel now.

seancorfield 2017-08-25T22:08:34.000187Z

This seems to "mostly" work but has broken my code once (doing an operation that work not break in Indent mode) and it sometimes produces really funky indentation so I think I'm going to turn it back off for now @rgdelato

rgdelato 2017-08-25T22:10:40.000015Z

Okay, fair enough. If you have the time, please report your issues on the repo! https://github.com/shaunlebron/parinfer/ Shaun is currently busy making a new website and preparing a Conj talk for Parinfer, so it won't be fixed immediately, but having these issues documented is really important

rgdelato 2017-08-25T22:11:36.000101Z

@seancorfield

seancorfield 2017-08-25T22:12:40.000043Z

Aye, if I can reproduce the weirdness I saw, I will definitely let Shaun know.

seancorfield 2017-08-25T22:13:51.000052Z

This particular issue seemed to be an interaction between Parinfer's "smart mode" and Paredit's attempt to indent code after a slurp operation wrapped across multiple lines.