Fork me on GitHub
#parinfer
<
2018-01-30
>
tianshu02:01:32

Still can't understand the how things work in parinfer.js, so I wrote with my own understanding of what it should be. Now trying to find the solution for best performance, hope to be available soon.

cfleming02:01:32

@doglooksgood That’s a whole rewrite of smart mode?

tianshu02:01:49

yes, whole rewrite.

tianshu03:01:16

I decide to have only smart mode. no custom options. @cfleming

cfleming03:01:07

Sounds good - I’ll be doing that in Cursive too. Make sure you check out the test cases though, there are lots of corner cases and Shaun put a lot of work into dealing with them.

cfleming03:01:37

I mean, I’ll only be having Smart Mode, not that I’ll be rewriting parinfer too.

tianshu06:01:08

@cfleming I'm stuck with the perf issue, emacs has some built-in support for query syntax of code. I use them to get some information like "whether the cursor is on comment or not?", instead of parse the code in string. but I found it is likely slower. Is cursive try to keep logic as the same as parinfer.js or write its own?

tianshu06:01:08

and I hope there's a post on how parinfer works, like in its homepage. 1 we remove the unstable close paren, 2 we insert the close paren according to the openers and indentation. obviously, this is a brief and the real is not simple like this. but I want a article for the rule of smart mode and the flow of how it works.

cfleming07:01:44

@doglooksgood Yes, Cursive uses a port of parinfer.js to Kotlin (based on parinfer-jvm, but my version is quite different from that now).

cfleming07:01:04

So when Shaun makes a fix I just port it over.

tianshu07:01:23

I think it's pretty hard to make a perf good. 😢

tianshu07:01:42

maybe my implementation is too naive.