Fork me on GitHub
#calva
<
2018-12-16
>
pez08:12:10

Yes, datify and nav!

lilactown08:12:45

I've been hacking on datafy and nav in cljs master

lilactown08:12:02

Mostly datafy. Is pretty neat

pez08:12:54

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.

pez09:12:37

@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.

mseddon11:12:55

Cljfmt returns "\n" for me I think too on windows

mseddon11:12:20

let me do a quick check

mseddon11:12:25

seems to. it may be different under the jvm of course.. so that's a tricky edge case

mseddon11:12:28

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"))

pez11:12:06

I think I run the tests under the jvm. I'd like to know how you do to run them in cljs. 😀

mseddon11:12:47

oh, doh, yes, that is probably what is happening 😄

pez11:12:15

I stared my eyes to the brink of bleeding on that code until I realized it must be the input that was funny.

mseddon13:12:46

I'm currently only running this new lexer at document load, but it is at least doing something useful!

pez17:12:47

Looks cool. Why are you not using rewrite-clj, btw?

pez17:12:58

@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.

mseddon17:12:38

🙂 that should do the trick

mseddon17:12:48

I will test it out after dinner

mseddon17:12:36

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

mseddon17:12:25

it may be possible to integrate this back into it's zipper format later though

mseddon18:12:35

@pez hey, that is working really well, nice job!

pez18:12:32

Thanks! I'll publish a new version later tonight then. I think my next thing to focus on will be done kind of jack-in, making it easier to get started with Clojure using vscode.

mseddon18:12:24

Ooh yeah. A proper jack in would be nice

pez23:12:29

And now Calva has switched to the calva-lib dev process.