Fork me on GitHub
#parinfer
<
2018-02-20
>
shaunlebron00:02:21

🔥 probably the most promising idea for Locus was just posted by @ivanreese here https://twitter.com/spiralganglion/status/965731142996451329

shaunlebron00:02:55

you’ll have to read the discussion that follows for full context

shaunlebron00:02:15

looking forward to trying it out

shaunlebron00:02:03

(Locus is what I alluded to in my talk to help reading lisp, to complement how Parinfer helps writing lisp)

spiralganglion00:02:15

@shaunlebron — It didn't occur to me to come by Slack until just now. I'm here if you feel like hashing things out in a more verbose form, hah.

dominicm08:02:33

I'm apparently rate limited on Twitter...

dominicm17:02:36

I couldn't view the tweet until late morning. It was odd.

cfleming21:02:18

@shaunlebron You mentioned the other day that you saw bad performance with parinfer in the CLJS project in Cursive. I’m looking at it now and I’m not seeing that.

cfleming21:02:37

Were you doing anything specific? What were the performance issues you saw?

cfleming22:02:05

@shaunlebron Ok, thanks. I think that’s just an artifact of the fact that the highlighting is asychronous.

cfleming22:02:20

I don’t think I can do much with that, unfortunately.

shaunlebron22:02:51

not sure if you could see, so let me clarify

shaunlebron22:02:04

i hit backspace on the red area to correct the indentation

shaunlebron22:02:25

and there was a ~1 second delay before it took effect

cfleming22:02:27

Right, but I think that’s because the highlighting tasks are run asynchronously. That highlighting isn’t driven directly by changes in the editor. When the doc changes, IntelliJ then re-highlights the whole file, and the highlighting pass which adds those markers is run again, checks indentation over the whole file and adds markers where needed.

cfleming22:02:41

For such a big file, that can take a while.

shaunlebron22:02:34

you have an idea why you’re not seeing the same behavior on yours?

cfleming22:02:52

It’s unfortunate, but trying to do it incrementally as the user is editing would be really complicated. I might be able to raise the priority of the highlighting task, I’m not sure.

cfleming22:02:14

Let me check again. It may just be that I’m seeing what I expect, and you’re not seeing what you expect 🙂

cfleming22:02:40

IntelliJ users are generally used to the highlighting not being immediate.

shaunlebron22:02:53

but it’s not highlighting that’s slow

shaunlebron22:02:01

i’m probably still misunderstanding

cfleming22:02:12

You’re talking about the red markers being taken away when the indentation is corrected, right?

shaunlebron22:02:22

I hit backspace here:

|(foo)
it takes ~1 second before I see:
|(foo)

cfleming22:02:41

So you’re talking about a delay for the actual text to be updated?

shaunlebron22:02:56

i hit backspace, and it took a long time for it to take effect

cfleming22:02:06

Ok, then I don’t see that. I do see a delay for the marker to be removed, but the text moves immediately.

cfleming22:02:09

Ok, one sec

cfleming22:02:43

Yeah, I see that in that case, however it’s not parinfer-related, I also see that when parinfer is disabled.

cfleming22:02:05

It seems to be specific to the thing you did. So you hit backspace at the start of a line, and what IntelliJ does in that case is tries to be clever, and deletes the whitespace at the start of that line and puts the caret at the end of the previous line. I think that requires it to calculate formatting information, and I just think that’s slow on a file this big.

cfleming22:02:06

So if I type on that line, or just delete some normal whitespace that doesn’t require any formatting info, it’s fast.

shaunlebron22:02:58

so you can reproduce?

shaunlebron22:02:15

cool, same page now then

cfleming22:02:18

But I won’t investigate that as part of this change, since it’s not related to parinfer.

cfleming22:02:10

I suspect my formatting model creation code could be faster (I need to switch to transducers rather than seqs), which would probably help that. Not having 11k line files would probably also help.

cfleming22:02:32

Re: the other feedback, as we discussed F2 is standard in IntelliJ and does find those markers. One issue with that though is that the markers are set to have warning level. The way that F2 works is it finds things in order of priority - if you have error level markers then it’ll only cycle through those, then all the warnings etc.

cfleming22:02:12

So in that file, it takes a while to find the indentation issues because they get buried in all the unused symbols etc.

cfleming22:02:59

Similarly with the gutter markers - the indentation ones do appear there, but not in red since that’s the colour for error level markers. They’re there in yellow, but they get drowned out by all the other crap in that file.

cfleming22:02:41

Again, because the file is enormous, all the warning markers in the file get compressed into the single gutter space. It’s not ideal in this case, but I can’t change it easily.

cfleming22:02:44

I don’t want to give those markers higher priority, because they’re not actually errors. If people start reporting this as an issue, I’ll think about a specific “Jump to indentation problem” action.

cfleming22:02:49

Hopefully finding them also won’t be an issue if I only run over affected top-level forms, since you’ll only have to correct indentation where you’re actually working anyway.