This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-12
Channels
- # aleph (10)
- # beginners (79)
- # boot (81)
- # chestnut (3)
- # cider (9)
- # cljs-dev (336)
- # cljsrn (17)
- # clojure (121)
- # clojure-boston (1)
- # clojure-italy (4)
- # clojure-nl (1)
- # clojure-russia (218)
- # clojure-spec (32)
- # clojure-uk (98)
- # clojurescript (109)
- # cloverage (1)
- # core-async (5)
- # cursive (17)
- # datascript (15)
- # datomic (38)
- # editors (4)
- # emacs (6)
- # graphql (1)
- # hoplon (140)
- # instaparse (1)
- # jobs (2)
- # klipse (1)
- # leiningen (4)
- # lumo (2)
- # mount (103)
- # off-topic (3)
- # om (8)
- # onyx (19)
- # parinfer (32)
- # pedestal (3)
- # precept (32)
- # re-frame (33)
- # reagent (24)
- # remote-jobs (11)
- # rum (1)
- # spacemacs (1)
- # specter (37)
- # unrepl (4)
- # untangled (43)
- # vim (11)
@cfleming: good point! I think I can just adjust result.indentDelta
at commitChar
since we can detect when characters are added/deleted there
@cfleming: had a chance to look at it, this kind of thing can only happen when forceBalance
is true, and i did a quick sandbox test, and it seems to work well with the fix i described
pushed 3.0.1 with the fix
unfortunately none of the indentMode tests are running with forceBalance
, but I made an issue to fix that and will be able to verify more fully then
@sekao: yeah, rubber-ducking is definitely what it is! I didn’t open reddit/twitter/hackernews at all, which is a miracle
Ok. I found a case yesterday which didn’t work correctly, at least in Atom - I haven’t had time to make a test case yet.
ah, yeah, I should note that forceBalance
is defaulted to true in my fork because @chrisoakman doesn't like the v2 changes (and my fork was originally an actual PR)
@cfleming: hmm, can’t reproduce in sandbox.js. you can try this there:
console.log(parinfer.testIndentMode(`
(if ((or true
+
false))
+
(do-something))
`));
I get the following output:
(if ((or true
false))
(do-something))
@shaunlebron Ok, I’ll check it out later. It might also be a problem with the Atom integration - @rgdelato might have an idea why.
actually, the changes can be given in any order I just realized, since I’m just creating a map from it
For example, when the char is (
, the next nice indent is either +2 or +1+first-word-length
the tabstops are the positions of the parent open-parens
your example is the intended usage—determining your own offset from the open paren
lemme get an example
@eraserhd the test cases for tabstops shows examples of where the tabstops are: https://github.com/shaunlebron/parinfer/blob/master/lib/test/cases/indent-mode.md#tab-stops
lemme know if that answers your question
I love your tests, by the way. I do that sort of thing a bunch, and people usually whine about how much effort it is until they see it.
would love to see your take on these kinds of tests if public!
Well, kind of. Here's from avi, a vim clone that I sort of don't work on anymore: https://github.com/maitria/avi/blob/master/test/avi/t_splits.clj#L67-L75
I was trying to rewrite them to do this: https://github.com/maitria/avi/blob/master/test/spec.txt
My best was when working on iPad games. For Polar Puzzles, there were ascii characters for all the board pieces, and each case was run in all four rotations. https://itunes.apple.com/us/app/polar-puzzles-free/id450788000?mt=8