This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aatree (1)
- # admin-announcements (6)
- # alda (3)
- # beginners (66)
- # boot (41)
- # cider (4)
- # cljsjs (3)
- # cljsrn (18)
- # clojure (146)
- # clojure-android (2)
- # clojure-nl (1)
- # clojure-russia (35)
- # clojure-sdn (2)
- # clojure-sg (5)
- # clojure-uk (41)
- # clojurescript (116)
- # datomic (12)
- # dirac (40)
- # docker (2)
- # editors (2)
- # hoplon (85)
- # immutant (19)
- # jobs (1)
- # keechma (2)
- # lein-figwheel (8)
- # mount (33)
- # off-topic (1)
- # om (114)
- # onyx (159)
- # parinfer (24)
- # proton (3)
- # reagent (4)
- # ring-swagger (15)
- # uncomplicate (7)
- # untangled (93)
- # yada (30)
Then it gets a “file was updated on disk” event, which I can catch but I can’t modify the document during.
Then after that I get some document updates, which I debounce and run parinfer after 10ms.
Unfortunately there’s no way I can think of to reliably run paren mode between the updates, since I don’t have the intermediate document states when I finally come to run indent mode after debouncing.
i.e. if there’s a file reload event I can mark that file as needing paren mode, but if there are more updates before I actually run paren mode then the document is modified in place and I can’t get the previous version. Even if I could, if paren mode modifies it then the later updates may be invalid since the document will have changed.
Ugh I'm glad I didn't go far down the road of trying to write a neovim backed intellij editor plugin.
@snoe: Yeah, I’ve actually considered that myself but I suspect it would be difficult.
All the complexity means that massive codebases work really well, but this sort of integration is not easy. This is one of the most difficult things I’ve had to shoehorn into IntelliJ, which I didn’t expect.
I’m not sure there is a precedent for the type of transformation that parinfer performs
@shaunlebron: I’d agree with that - I can’t think of any other transformation that works like this, except something like file formatting.
Certainly IntelliJ isn’t really designed for it, but it’s not really designed for text-based manipulation based on events in general.
Anyway, my workaround now works, the only corner case is if the user manages to create a manual event within 10ms of the file being opened, that event will get paren mode instead of indent mode. It seems very unlikely that this could happen based on user input, but some kind of plugin modifying the doc based on some event might happen.
@cfleming: thank you for staying on top of parinfer-jvm and pushing that update with
@jasongilman: not yet; still need to give it a think. have been focusing elsewhere the last week or so
@chrisoakman: No worries, I’ll have to push a point release, I realised that there are some
=== that sneaked in there from cut’n’pasted code.
All the tests pass, it may not actually be a problem, but I’ll fix that in the next couple of days.
Thanks @chrisoakman. Parinfer in Atom is great. I never hear anyone mention Atom and Clojure without also saying "And of course you should use Parinfer too"
i released nightcode 1.1.0 with parinfer 😃 i’ll be teaching my java class some clojure next week using it so i’ll let y'all know how it goes