Fork me on GitHub
#cursive
<
2016-03-18
>
wilkerlucio01:03:02

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

cfleming01:03:47

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

cfleming01:03:05

Basically IntelliJ has a very complex infrastructure around file handling.

cfleming01:03:13

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.

cfleming01:03:57

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.

cfleming02:03:28

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.

cfleming02:03:41

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

wilkerlucio02:03:19

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

cfleming02:03:41

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

cfleming02:03:05

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.

wilkerlucio02:03:22

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

cfleming02:03:16

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.

cfleming02:03:45

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

wilkerlucio02:03:41

I'm glad you got that working too simple_smile

wilkerlucio02:03:51

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

cfleming02:03:16

@wilkerlucio: No worries, seeya!

ricardo11:03:25

@cfleming: Does Cursive support IDEA 16.1?

ricardo11:03:44

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