parinfer

rgdelato 2017-08-07T00:16:06.199950Z

would it be possible for Parinfer to be a standalone executable that other editors can call out to?

cfleming 2017-08-07T00:32:42.310237Z

@rgdelato I don’t see why not - do you have a use case in mind?

cfleming 2017-08-07T00:33:01.312377Z

I guess you’d pass it a file path to be processed, and it could return the edits as we discussed above?

rgdelato 2017-08-07T00:34:37.323113Z

not particularly, just that it would mean that there wouldn't have to be ports of the code to different langs. write it once in something fast

cfleming 2017-08-07T00:36:45.337695Z

Depending on the editor, it’s not always that easy to shell out to something.

cfleming 2017-08-07T00:37:24.342264Z

Or at least, to get a copy of the document efficiently. I guess you could always save + apply it, but that would mean that the user’s doc would be being saved continuously.

rgdelato 2017-08-07T00:37:37.343638Z

yeah, that was what I was worried about. okay.

cfleming 2017-08-07T00:37:49.344989Z

Unless you write out a temp file, and then it doesn’t matter how fast your algorithm is 🙂

cfleming 2017-08-07T00:38:50.351942Z

But I think having the reference impl in something that’s more amenable to either manual or automatic translation might be a good step worth investigating.

cfleming 2017-08-07T04:51:53.533610Z

So I have a draft of the change to process the whole file and apply edits. Most of the indent mode tests work now, I’m gradually working through the failures. Hopefully I’ll have something to show tomorrow.

cfleming 2017-08-07T04:52:26.538348Z

If I get stuck debugging any of the problems I’ll push a WIP.

shaunlebron 2017-08-07T04:53:04.543363Z

thanks!

shaunlebron 2017-08-07T04:53:11.544286Z

for parinfer.js?

cfleming 2017-08-07T04:53:14.544810Z

Right.

shaunlebron 2017-08-07T04:53:28.546582Z

can’t wait to see it

cfleming 2017-08-07T04:53:51.549831Z

Actually I can push a WIP now if you’re keen - give me 5 mins or so.

shaunlebron 2017-08-07T04:54:18.553425Z

👍

shaunlebron 2017-08-07T04:54:52.558326Z

this would help parinfer reach notepad++ as well

shaunlebron 2017-08-07T04:55:06.560393Z

chris called it the most popular editor in the world

cfleming 2017-08-07T04:55:21.562570Z

According to StackOverflow it is, yeah

cfleming 2017-08-07T05:06:58.665284Z

There’s still a fair amount of tidying up to do, including things like handling \r\n correctly and probably revising some of the names (origText -> text etc)

cfleming 2017-08-07T05:07:34.670290Z

Most of the indent mode tests pass now, I haven’t looked at the paren or smart mode ones yet but a reasonable number of them pass too.

cfleming 2017-08-07T05:07:59.673650Z

So hopefully the approach is basically sound and there are probably just some bugs lurking there.

cfleming 2017-08-07T05:08:35.678848Z

I have to head out now, but if you have questions let me know and I’ll try to get to them later this evening.

cfleming 2017-08-07T05:10:55.698811Z

I’m also planning to revise the edit accumulation and application to the result text, I’m not sure that catches all cases when e.g. edits overlap.

cfleming 2017-08-07T05:11:19.702187Z

Ok, GTG

shaunlebron 2017-08-07T05:40:16.963132Z

thanks! did a quick lookover—not a lot of changes!

cfleming 2017-08-07T05:40:30.965262Z

No, it’s relatively small.

cfleming 2017-08-07T05:41:02.970416Z

In my initial version I tried to use offset in more places rather than lineStart/x combos, but that made the change larger than it needed to be.

cfleming 2017-08-07T05:41:16.972673Z

If this becomes the definitive version that might be something to consider.

cfleming 2017-08-07T05:41:44.977222Z

I’m hopeful that the remaining bugs are relatively straightforward.

cfleming 2017-08-07T05:44:00.998156Z

Seems likely, given that a large chunk of the tests pass.

shaunlebron 2017-08-07T05:44:34.003596Z

i’ll give it a more thorough look in the morning. i can probably fix the rest quickly. i’m pretty convinced this is the right move btw

shaunlebron 2017-08-07T05:45:27.011877Z

thanks for keeping the diff small, very helpful

cfleming 2017-08-07T05:45:53.015843Z

There are probably some edge cases to consider around the processing at EOF if the file doesn’t end in \n too - some of the processing that was at the end of processLine is now in onNewline and also in finalizeResult. If those calls are not idempotent there might need to be some more state there to track that.

shaunlebron 2017-08-07T05:47:04.027196Z

i saw some of the calls shifted around for that—did it help this?

cfleming 2017-08-07T05:48:04.036762Z

Did it help what, sorry?

shaunlebron 2017-08-07T05:52:43.081964Z

oh I mean was it important to this edits feature to move it around?

shaunlebron 2017-08-07T05:53:49.092304Z

gonna get some sleep and try in the morning

cfleming 2017-08-07T06:01:58.177179Z

Cool, GTG too, talk tomorrow

shaunlebron 2017-08-07T19:20:53.171834Z

streaming my work on it now

shaunlebron 2017-08-07T19:22:21.214367Z

current issue is that the edit from correctParenTrail seems to be interfering with previous edits that remove unmatched close-parens on the spot

cfleming 2017-08-07T19:27:58.376422Z

Ok, can’t really get on now (looking after my daughter) but the issue might be in how the edits are applied in resultText

shaunlebron 2017-08-07T19:28:30.391924Z

np, streams are recorded if you wanna look back

shaunlebron 2017-08-07T19:28:33.393575Z

just helps me focus too

cfleming 2017-08-07T19:28:56.404474Z

Ok, will be around in an hour or two

shaunlebron 2017-08-07T19:29:02.407435Z

👍

shaunlebron 2017-08-07T20:11:03.635565Z

having trouble picking a starting point

shaunlebron 2017-08-07T20:11:25.645820Z

i fixed one test and broke all the others

shaunlebron 2017-08-07T20:12:27.675375Z

going to try to keep the same processLine logic to be sure that stuff is happening in the right order

shaunlebron 2017-08-07T20:24:02.012266Z

wanna try replacing inputLines iteration with origText iteration first

shaunlebron 2017-08-07T20:25:16.048947Z

then changing replaceWithinLine to append an edit, then building result text

shaunlebron 2017-08-07T20:26:22.082142Z

will help me isolate what went wrong

cfleming 2017-08-07T22:09:57.801858Z

@shaunlebron Sorry, that took longer than expected - had to take the cat to the vet

cfleming 2017-08-07T22:10:12.806563Z

I’ll pull in your changes and then take a look.

shaunlebron 2017-08-07T22:12:12.845904Z

np

shaunlebron 2017-08-07T22:12:44.856439Z

changes are not ready. was starting over later to things more incrementally

cfleming 2017-08-07T22:16:58.938305Z

@shaunlebron Have you ever tried floobits?

cfleming 2017-08-07T22:17:20.945093Z

We could give that a go if you have some more time to look at it later.

shaunlebron 2017-08-07T22:19:57.995068Z

i tried installing it for atom and it never initialized correctly

shaunlebron 2017-08-07T22:20:12.999824Z

i can try it for another editor

cfleming 2017-08-07T22:22:51.050399Z

I’ll sign up for a free plan and install it for IntelliJ

cfleming 2017-08-07T22:23:58.070604Z

Looks like they have neovim

shaunlebron 2017-08-07T23:16:47.974585Z

is anyone available for testing atom-parinfer on master?

shaunlebron 2017-08-07T23:17:10.980623Z

the options screen isn’t showing up for chris, and I’d like to see if it’s working for others

rgdelato 2017-08-07T23:27:16.138490Z

I pulled master, restarted Atom, and I'm seeing the settings screen

shaunlebron 2017-08-07T23:27:26.140971Z

thanks!

shaunlebron 2017-08-07T23:27:29.141647Z

what version are you on?

rgdelato 2017-08-07T23:28:01.149790Z

1.18.0 x64 on OSX and Atom claims it's up to date

shaunlebron 2017-08-07T23:28:17.153616Z

chris couldn’t get it to show up on 1.17.2

chrisoakman 2017-08-07T23:28:27.156099Z

Or 1.17.0

shaunlebron 2017-08-07T23:28:30.156803Z

and the config API between them seem the same

shaunlebron 2017-08-07T23:28:40.159130Z

i wonder if people are upgrading their editors

rgdelato 2017-08-07T23:31:05.197004Z

so Chris is just seeing "Uninstall" and "Disable" buttons and no "Settings" button?

shaunlebron 2017-08-07T23:31:41.206205Z

i installed 1.17.2 from github releases, and deleted 1.18.0

shaunlebron 2017-08-07T23:31:50.208405Z

@chrisoakman can you send us a screenshot?

shaunlebron 2017-08-07T23:35:08.256947Z

why is that showing the parinfer readme instead of the atom-parinfer readme

shaunlebron 2017-08-07T23:35:31.262410Z

you are symlinking the package to the wrong directory

rgdelato 2017-08-07T23:36:16.273754Z

I was about to say, that Readme looks totally different from mine as well

chrisoakman 2017-08-07T23:40:14.331264Z

I fixed whatever was going on with that. I still have no settings.

chrisoakman 2017-08-07T23:40:29.334746Z

Do you see settings with v1.17.2?

shaunlebron 2017-08-07T23:40:48.339559Z

the screenshot shows the version page above it

shaunlebron 2017-08-07T23:41:22.347775Z

@chrisoakman make sure Parinfer is capitalized

cfleming 2017-08-07T23:42:05.358198Z

@shaunlebron Got a question when you have a minute

shaunlebron 2017-08-07T23:45:04.400996Z

actually should it be capitalized?

shaunlebron 2017-08-07T23:46:23.419542Z

config-key should namespace the config keys to the case of the package I’m guessing

shaunlebron 2017-08-07T23:47:58.442352Z

looks like it should be lowercased https://atom.io/packages/parinfer, not sure why I had it capitalized?

rgdelato 2017-08-07T23:48:06.444160Z

in general, it's kinda weird that it's capitalized since it puts Parinfer before all my other packages in alphabetical order

shaunlebron 2017-08-07T23:50:51.483384Z

i’m not sure why i ever capitalized it. the readme instructions even give wrong instructions? shouldn’t it be ln -s <atom-parinfer dir> ~/.atom/packages/parinfer?

rgdelato 2017-08-07T23:51:20.490243Z

I run apm link from inside the atom-parinfer directory

shaunlebron 2017-08-07T23:53:18.517627Z

that explains the capitalization, the package.json name is “Parinfer”

shaunlebron 2017-08-07T23:53:53.525934Z

submitting a PR

chrisoakman 2017-08-07T23:54:45.537866Z

I already fixed it.

shaunlebron 2017-08-07T23:55:23.546343Z

you renamed the package?

shaunlebron 2017-08-07T23:56:18.559165Z

https://discuss.atom.io/t/renaming-a-package/5816/3