chlorine-clover

About Chlorine for Atom and Clover for VS Code: https://atom.io/packages/chlorine and https://marketplace.visualstudio.com/items?itemName=mauricioszabo.clover
2019-11-05T00:01:41.183700Z

re: beta channel -- i wonder if this could be faked by having a chlorine-beta plugin...i guess that could get messy with settings

seancorfield 2019-11-05T00:30:43.184400Z

@mauricio.szabo I just updated to 0.3.1, connected to a Clojure Socket REPL, and can't load file any more (not supported in that type of REPL). Known issue?

seancorfield 2019-11-05T00:30:54.184700Z

(looks like it based on your comments above)

seancorfield 2019-11-05T00:33:13.185600Z

(I just switched my keymap so ctrl-; y is chlorine:connect-socket-repl which seems to work with my REBL setup and load-file does work with that REPL)

mauricio.szabo 2019-11-05T00:44:36.186200Z

Yes, there's a problem with that :(

mauricio.szabo 2019-11-05T00:44:56.186500Z

I'll publish a fix

mauricio.szabo 2019-11-05T01:52:16.187100Z

Just got it working again, will publish a new version after the CI run πŸ™‚

πŸ‘ 1
mauricio.szabo 2019-11-05T01:59:08.187200Z

Great, any problems tell me πŸ™‚. This new way to connect changes a lot of code on the way to treat the socket connection, so it can be possible to control backpressure on the future πŸ™‚

mauricio.szabo 2019-11-05T02:15:13.187500Z

I once though about something like that. Problem is that it makes deploy awfully complicated... Like, it is already kinda hard to deploy Chlorine because I need to version all compiled code (well, currently I configured CircleCI to do it)

mauricio.szabo 2019-11-05T02:18:17.187700Z

I could generate a chlorine-beta, but then I would have to or have two repositories, or keep changing the name on package-json so it would deploy to the right place. This could pose a problem to automate

mauricio.szabo 2019-11-05T02:29:28.188400Z

@henrik I think this last release fixes the problem you mentioned too πŸ™‚

2019-11-05T02:56:27.189400Z

ok, load file seems to work after "chlorine: connect socket repl" :thumbsup: this is with 0.3.2 -- that's the latest, right?

2019-11-05T02:56:45.189500Z

may be it's not worth the trouble then

seancorfield 2019-11-05T03:04:56.190400Z

Load file worked for me with the generic connect, but not with the Clojure connect, in 0.3.1. Just FYI @sogaiu

seancorfield 2019-11-05T03:05:32.190600Z

(I haven't tried 0.3.2 yet)

2019-11-05T03:17:59.190800Z

@seancorfield thanks!

2019-11-05T03:29:24.192700Z

i can connect with clojure clr using "chlorine: connect socket repl" :thumbsup: "chlorine: load file" doesn't show up for me in the command palette and "chlorine: evaluate selection" gives me:

Syntax error (InvalidOperationException) compiling at (REPL:5:636).
Unable to resolve symbol: str in this context
when the selection is for (def a 1)

2019-11-05T03:32:20.193600Z

it looks like there is no (ns ...) (or something to arrange for clojure.core to be available) being evaluated before (in-ns ...) -- under those conditions, perhaps clojure.core/str isn't available?

mauricio.szabo 2019-11-05T12:30:50.197600Z

Yes, that's probably the case. I think you need to evaluate the ns form before anything else. I'll see if I can find a solution that doesn't involve creating new namespaces all the time...

mauricio.szabo 2019-11-05T12:31:23.197800Z

(for example, for ClojureScript in lumo or plank there's no way to solve this problem)

2019-11-05T03:33:31.194100Z

(i'm using wireshark to observe the network traffic)

2019-11-05T03:40:14.194700Z

connecting to babashka via "chlorine: connect socket repl" works fine as well as "chlorine: evaluate selection" πŸ™‚

henrik 2019-11-05T07:01:56.195600Z

The new connection method seems to work well! Awesome!

henrik 2019-11-05T07:02:49.195700Z

I’m getting some warnings about Reagent (which I don’t have in my CLJS project) when connecting.

henrik 2019-11-05T07:05:05.196100Z

And some more when just typing in the current file. (All this in CLJS)

mauricio.szabo 2019-11-05T12:32:35.198Z

Okay, this is some leaking code, I'll try to fix it too...

mauricio.szabo 2019-11-05T12:33:26.198200Z

This is happening in shadow-cljs, or on some other cljs implementation?

henrik 2019-11-05T12:59:10.198800Z

No, this is shadow-cljs. I don’t know if it has anything to do with it, but I run shadow programmatically:

(shadow-server/start!)
(shadow/watch :client)

mauricio.szabo 2019-11-05T14:16:35.201600Z

No, it doesn't. The problem is probably because, on autocomplete, there's lots of evaluation commands being emitted, and outputs can become overlapped

mauricio.szabo 2019-11-05T14:17:09.202200Z

Like, I'm expecting: [<eval-id> <result>]\n and i get: [<eval-id> <result>][<eval-id result>]\n\n

henrik 2019-11-05T14:34:11.202500Z

Ah, so it’s being hammered in, not queued

mauricio.szabo 2019-11-05T15:22:25.202700Z

Yes, I'm trying to somehow make a single implementation that's able to ignore these cases. The sad part is that it is really hard to test these issues...

borkdude 2019-11-05T07:48:09.197500Z

@mauricio.szabo do you need anything special for autocomplete in bb?

mauricio.szabo 2019-11-05T12:34:45.198400Z

All my autocomplete uses ns-mappings, aliases, and other code that inspects the current namespace. As bb doesn't have namespaces, I don't know how it could be implemented...

borkdude 2019-11-05T12:37:34.198600Z

OK. If users really want it, I can see what can be done about this. But it's already great it works with Chlorine without it. Thanks

mauricio.szabo 2019-11-05T13:23:18.199Z

Yes, the thing is that when I added support for multiple REPLs, I also configured some commands to return different implementations for known Clojure implementations

mauricio.szabo 2019-11-05T13:24:04.199200Z

The thing that really surprised me is that both ClojureCLR and Joker's autocompletes worked on the first try

mauricio.szabo 2019-11-05T14:04:39.200300Z

@sogaiu also, for ClojureCLR the load-file command is not yet supported, that's why it doesn't appear. It doesn't appear also for Joker/bb/Lumo/Plank

dpsutton 2019-11-05T14:07:08.200900Z

for repls without a load file, its best to just load forms one by one?

mauricio.szabo 2019-11-05T14:16:07.201500Z

Probably. Maybe I'll add a function to do it

dpsutton 2019-11-05T14:16:59.202100Z

cool. i'm trying to learn chlorine and it seems quite nice πŸ™‚

seancorfield 2019-11-05T16:10:59.203100Z

Maybe select all then evaluate selection?

πŸ‘ 1
mauricio.szabo 2019-11-05T16:12:02.204200Z

This should work πŸ™‚. I'll probably add a command to it πŸ™‚

mauricio.szabo 2019-11-05T16:12:37.205Z

(I hope it works on CLJS, unfortunately ClojureScript adds lots of limitations for multiple operations)

borkdude 2019-11-05T22:43:48.205200Z

fwiw, babashka has load-file

2019-11-05T23:09:30.206900Z

fwiw, for clojure clr, select all followed by evaluate selection doesn't work here:

user=> #object[Namespace 0x12983669 "sample"]
Syntax error (InvalidOperationException) compiling at (REPL:4:642).
Unable to resolve symbol: str in this context
sample=> 
the source of the file is:
(ns sample)

(def a 1)
this seems similar to previous situation -- there is no clojure.core/str yet. possibly the in-ns is occuring before the ns?

2019-11-05T23:13:04.207700Z

here is some output from wireshark's follow tcp stream:

user=> 
#?(:cljs :using-cljs-repl :clj :using-clj-repl :cljr :using-cljr-repl :joker :using-joker-repl :bb :using-bb-repl)
:using-unknown-repl
user=> :using-cljr-repl
user=> :using-unknown-repl
user=> (in-ns 'sample)(try  (clojure.core/let [res (do (ns sample) (def a 1) )  res (clojure.core/cond  #?(:cljs false :default (clojure.core/ratio? res))  (clojure.core/symbol  (clojure.core/str "#repl-tooling/literal-render \""  (clojure.core/pr-str res) "\""))  (clojure.core/symbol? res)  (clojure.core/symbol (clojure.core/str "#unrepl/bad-symbol [nil "  (clojure.core/pr-str (clojure.core/str res))  "]"))  (clojure.core/keyword? res)  (clojure.core/symbol (clojure.core/str "#unrepl/bad-keyword ["  (clojure.core/pr-str (clojure.core/namespace res)) " "  (clojure.core/pr-str (clojure.core/name res))  "]"))  (clojure.core/->> res type str (clojure.core/re-find #"Big(Decimal|Float)"))  (clojure.core/symbol (clojure.core/str "#unrepl/bigdec "res))  (clojure.core/->> res type str (clojure.core/re-find #"BigInt"))  (clojure.core/symbol (clojure.core/str "#unrepl/bigint "res))  :else res)]  ['tooling$eval-res 'G__22 {:result (clojure.core/pr-str res)}])  (catch System.Exception e  ['tooling$eval-res 'G__22 {:error (clojure.core/pr-str e)}])) 
#object[Namespace 0x12983669 "sample"]
Syntax error (InvalidOperationException) compiling at (REPL:4:642).
Unable to resolve symbol: str in this context
sample=> 

2019-11-05T23:14:47.209400Z

it looks like in-ns is happening before the first ns. perhaps the try is compiled in that context and that affects how things (e.g. clojure.core/str) are resolved in its body?