This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-16
Channels
- # adventofcode (76)
- # aleph (1)
- # aws (2)
- # beginners (101)
- # boot (1)
- # boot-dev (1)
- # calva (25)
- # cider (12)
- # cljs-dev (29)
- # clojure (214)
- # clojure-europe (1)
- # clojure-nl (5)
- # clojure-spec (1)
- # clojure-uk (6)
- # clojurescript (155)
- # data-science (1)
- # datomic (48)
- # figwheel-main (5)
- # immutant (1)
- # leiningen (11)
- # nrepl (2)
- # off-topic (24)
- # pathom (2)
- # pedestal (2)
- # portkey (8)
- # protorepl (5)
- # re-frame (2)
- # rum (4)
- # shadow-cljs (21)
That is cool. I have been thinking about how to present more readable evaluations (before datafy and nav were introduced). Since it probably won’t be feasible to do it the way ProtoREPL does it, I’ve been looking at those custom tree views available for extensions. With nav that would make even more sense.
@mseddon I have found why the new-index gets wrong for CRLF, despite our fixes. Almost, at least. It’s cljfmt
that changes the newlines to LF when formatting. I need to look more closely at this in cljfmt now.
FAIL in (test-keeps-line-separator) (at C:475:6)
expected: (= (reformat-string "foo\r\nbar") "foo\r\nbar")
actual: (not (= "foo\nbar" "foo\r\nbar"))
I think I run the tests under the jvm. I'd like to know how you do to run them in cljs. 😀
I stared my eyes to the brink of bleeding on that code until I realized it must be the input that was funny.
I'm currently only running this new lexer at document load, but it is at least doing something useful!
@mseddon Apparently cljfmt/reformat-string
is supposed to replace all newlines with LF, regardless of what the input uses. I am supposed to use a wrapper (supplied by cljfmt) to fix it. But noobish as I am I couldn’t figure out how to use the wrapper, so I am now doing this instead:
(-> s
(cljfmt/reformat-string config)
(clojure.string/replace #"\r?\n" eol))
And now everything seems to work correctly with both LF and CRLF files. So I merged the fixes into the main branches. Please give it a spin before I publish a new version of Calva Format on the Marketplace.regarding rewrite-clj, the main thing here is ensuring everything is as fast and incremental as possible, so tokens on another line shouldn't even be touched if a different line is edited