This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-09
Channels
- # announcements (4)
- # beginners (71)
- # boot (258)
- # braid-chat (7)
- # business (3)
- # cider (5)
- # cljs-dev (5)
- # cljsrn (64)
- # clojure (154)
- # clojure-canada (1)
- # clojure-poland (112)
- # clojure-russia (290)
- # clojurebridge (1)
- # clojurescript (60)
- # community-development (1)
- # core-async (25)
- # cursive (9)
- # data-science (1)
- # datomic (40)
- # editors (14)
- # events (2)
- # hoplon (2)
- # jobs (3)
- # ldnclj (51)
- # lein-figwheel (2)
- # luminus (1)
- # off-topic (5)
- # om (57)
- # onyx (29)
- # overtone (1)
- # parinfer (52)
- # portland-or (1)
- # proton (17)
- # quil (2)
- # re-frame (77)
- # reagent (1)
- # ring-swagger (20)
- # spacemacs (1)
- # test-check (4)
- # testing (13)
- # yada (1)
@cfleming atom-parinfer uses 10ms https://github.com/oakmac/atom-parinfer/blob/master/src-cljs/atom_parinfer/core.cljs#L287-L293
sublime is doing 50ms https://github.com/oakmac/sublime-text-parinfer/blob/master/sublime-parinfer.py#L29
although that can probably be safely lowered
Vimscript port is complete
it's pretty rough around the edges right now, but all the tests pass
which is the important thing
@cfleming: debouncing essentially means "only execute parinfer every N milliseconds, even if the user is typing faster than N"
it's a common pattern you see in UIs that have event loops
@chrisoakman: right, I was just wondering what a good value for N was
not to my knowledge
there aren't too many Sublime parinfer users though
many more atom-parinfer users
with the JVM speed I would try 10ms first and see how it works
@chrisoakman that's cool, what kind of speeds do you see in viml?
I have no idea
hopefully that is useful though
think I might be done with Parinfer ports for a while now; I can't think of another major language that needs it
maybe Lua?
@chrisoakman: Ok, thanks, I’ll start with 10ms
Basically, due to the way that IntelliJ works, when I see a change I’ll start a timer, and I’ll coalesce all updates until the timer runs out. On each new change I’ll reset it, so the delay will basically be 10ms since the last change.
right
in JS it's pretty easy to do debounce; not sure in Java
There’s some additional complication around things like bulk changes (formatting etc) but that’s the gist of it
you might want to look at how it's done in the sublime-plugin
https://github.com/oakmac/sublime-text-parinfer/blob/master/sublime-parinfer.py#L170-L181
it just increments and decrements a counter
is the IntelliJ API that you're working with public?
debouncing was something that was necessary when parinfer was slow
but it looks like parinfer-kotlin is sufficiently fast
I just didn’t want parinfer to block the editor’s input thread
Parinfer on JS and JVM can process ~3000 lines about 60-100 times/second
and if a person types 120 wpm, that’s about 8 characters/second
so, parinfer can run 8-10 times between every keystroke without blocking the input thread
so @cfleming, you may want to try it without the debounce first since the JVM version is fast
@chrisoakman: thoughts on removing debounce?
@shaunlebron: Note that the issue isn’t just replacing the text, since in IntelliJ it also provokes a full parse of the file etc. I still think I’m going to debounce.
Anyone interested in a (huge, but very interesting) discussion on editor latency should see: https://pavelfatin.com/typing-with-pleasure/. Quite amazing results, too.
thanks for the reminder, @denik sent that to me a while back since it seems especially relevant to this
Probably a good idea to keep debounce in, even if it's only set for something like 10ms
in atom-parinfer, sometimes the editor will kick off several events even though the user would assume it is only 1
debounces handles those cases very cleanly
it's almost like a defense against aggressive editor events 😉
When using Indent mode in existing integrations, I believe indent and dedent pretty much just use 2 chars, right?
I know there’s been some discussion about smarter indenting, i.e. trying to choose the right indents to jump to.
Ah, this looks like https://github.com/shaunlebron/parinfer/issues/89