Fork me on GitHub
#parinfer
<
2017-08-25
>
shaunlebron01:08:30

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

shaunlebron01:08:43

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

shaunlebron01:08:34

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

shaunlebron01:08:12

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

shaunlebron01:08:53

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

cfleming06:08:01

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.

cfleming06:08:05

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.

shaunlebron08:08:19

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

cfleming08:08:03

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

cfleming08:08:28

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

cfleming08:08:44

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

cfleming08:08:32

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.

shaunlebron08:08:08

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

cfleming08:08:23

Right, IntelliJ actually draws those automatically anyway.

cfleming08:08:31

They’re really nice for Clojure.

shaunlebron08:08:05

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

shaunlebron08:08:22

(testing indent guides I mean)

cfleming08:08:50

Ok, I’ll check out those changes.

cfleming08:08:08

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

cfleming08:08:04

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

cfleming08:08:26

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

cfleming08:08:49

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

cfleming08:08:44

Looks nice!

cfleming08:08:33

BTW what do you use to record gifs?

shaunlebron08:08:51

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

shaunlebron08:08:29

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

cfleming08:08:17

And that converts to gif?

shaunlebron08:08:25

yeah, it exports

shaunlebron08:08:35

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

cfleming08:08:39

Cool, I’ll check it out.

cfleming08:08:12

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.

shaunlebron08:08:48

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

cfleming08:08:23

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)

cfleming08:08:41

To guide the user to do the right thing.

shaunlebron08:08:17

yeah, interesting

shaunlebron08:08:51

does cursive add indent guides under maps and vectors?

shaunlebron08:08:32

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

shaunlebron08:08:28

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

shaunlebron08:08:59

I’m up too late, catch up soon!

cfleming08:08:23

Ok, I’ll check it out, thanks!

rgdelato17:08:26

@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.

seancorfield18:08:18

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

seancorfield22:08:34

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

rgdelato22:08:40

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

seancorfield22:08:40

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

seancorfield22:08:51

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.

dominicm21:08:36

@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.

dominicm21:08:52

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