Fork me on GitHub
#calva
<
2018-12-22
>
pez11:12:59

This is a VSIX of Calva built using the new socket connection management I’ve mentioned. All tests I throw at it indicates that nothing that previously worked, would now be broken, and it really should only improve on things. I would appreciate some more people testing it before I release it on the marketplace. This version logs a lot of it’s nrepl connection/messaging successes and failures. So if you open the Development tools console you should see it fail decoding some huge messages right after the connection is established but after that it should mostly log a *results pending: {}. Now and then there are messages pending, but they shouldn’t stay there. If they do, please let me know.

slipset15:12:30

Seems like I’m playing with it now. Seems to work.

slipset16:12:19

@pez, if I may suggest some improvements to the code:

slipset16:12:15

you have an anon-fn which calls mapv with yet another anon-fn.

slipset16:12:31

I’d suggest teasing this apart a bit, so that the inner anon-fn becomes a top-level fn with a clear name. This way, it can be tested somewhat in isolation, and it’s easier to play with in the repl.

slipset16:12:35

Also, the way you’re deref’ing and swapping on the same atom inside that inner anon-fn is somewhat of an anti pattern, as the content of the atom can change between the derefs and the swaps.

slipset16:12:23

hmm, trying to refactor this is hard 🙂

slipset16:12:03

that forwards/backwards kill-sexp isn’t putting stuff in the copy/paste buffer is killing me 🙂

pez16:12:20

Thanks @slipset . I have been wanting to get it a bit more composer of smaller things, but haven't had a good idea about how to do it. It got pretty hard to work with because i couldn't use the repl.

pez16:12:00

Isn't there a cut forward command?

slipset16:12:00

maybe it is 🙂

slipset16:12:17

It might just be that I’ve used the wrong command 🙂

slipset16:12:26

This is not at all tested, it’s just me fiddling around with the code a bit.

slipset16:12:13

I don’t quite know how to test/run this (haven’t looked at the Readme :)

slipset16:12:08

And it’s most certainly not done. Just some inspiration.

slipset16:12:24

if it’s correct, I’d say it warrants a comment 🙂

slipset17:12:31

Yes, there is a cut-forward-sexp that does what I want 🙂

slipset17:12:26

in the docs it says

slipset17:12:31

> Run the npm watch build task

slipset17:12:52

when I type npm watch npm complains that there is no such task?

slipset17:12:57

npm run watch was the answer

pez17:12:35

The kill commands should be renamed to delete, so that they don't give the impression of going what emacs’ kill commands do.

slipset18:12:15

yeah, I guess that’s the thing that tripped me.

slipset18:12:39

btw my test-runs are failing with this:

slipset18:12:45

========= Running Tests =======================
SHADOW import error /Users/erik/Documents/github.com/calva-lib/.shadow-cljs/builds/test/dev/out/cljs-runtime/shadow.js.shim.module$paredit.js
Error: Cannot find module 'paredit.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at /Users/erik/Documents/github.com/calva-lib/.shadow-cljs/builds/test/dev/out/cljs-runtime/shadow.js.shim.module$paredit.js:3:33
    at global.SHADOW_IMPORT (/Users/erik/Documents/github.com/calva-lib/test-out/tests.js:59:44)
    at /Users/erik/Documents/github.com/calva-lib/test-out/tests.js:3028:1
    at Object.<anonymous> (/Users/erik/Documents/github.com/calva-lib/test-out/tests.js:3090:3)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
===============================================
[:test] Build completed. (84 files, 2 compiled, 0 warnings, 0.43s)

pez18:12:42

Good spotting about that bug with associng :message. The reason things still work is that I had that there for only to be able to see in the debug printing which nrepl message goes with which result.

pez18:12:40

I saw that error message about paredit.js missing when trying to package the VSIX. I wonder what it’s about.

slipset18:12:35

Anyways, it’s late in my TZ, so I’ll stop for now. TTYL

pez18:12:55

I’m in a later TZ. 😃

pez18:12:07

But I need to go as well. TTFN!