Fork me on GitHub

@cfleming: I would love to hear more about the difficulties of this integration, are you considering a blog post about it?


@wilkerlucio: I hadn’t planned one, no.


Basically IntelliJ has a very complex infrastructure around file handling.


Parinfer is designed to replace the whole file content on every keypress, basically. However in IntelliJ when I get a document modification event I can’t modify the document further, so I have to asynchronously update the doc later. However this greatly complicates undo/redo.


There’s lots of other trickiness - parinfer is also designed to have paren mode run when a file is opened in an editor, but because IntelliJ implements a caching file system layer, at editor open the file contents are the last contents IntelliJ saw, and then they’re later overwritten when it syncs to the file system. So again, it’s asynchronous and it’s difficult to merge that paren mode run into later indent mode runs.


And… documents in IntelliJ can have multiple editors open on them. Parinfer relies on receiving the caret position in order to make some adjustments to the raw algorithm, but there can now be multiple carets when multiple editors are open.


Not to mention multiple caret mode, which I’m currently ignoring 😐


oh, that seems pretty painful to handle, I really appreciate the effort you are putting on it, thank you


No worries - I should probably blog more about this stuff.


I was going to write about the lein integration since that was really difficult and it was of interest to a lot of people, but I never got around to it.


I agree, and I believe these kind of posts could potentially be a case to improve things in a way to get easier in the future


Well, in this case IntelliJ just isn’t designed to allow this sort of thing. I believe other editors have been problematic too, in general parinfer is a very unusual file change.


The lein one could have been used to make lein easier to integrate for sure.


I'm glad you got that working too simple_smile


@cfleming: I'm taking off, thanks for all the information


@wilkerlucio: No worries, seeya!


@cfleming: Does Cursive support IDEA 16.1?


Ah, nevermind, just read the reply from a few days ago.