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
fabrao 2021-05-11T09:19:39.131200Z

now I see there is something going to be connect! in https://github.com/mauricioszabo/atom-chlorine/issues/94 . Sorry about that

mauricio.szabo 2021-05-11T14:21:09.131600Z

@fabrao https://github.com/mauricioszabo/atom-chlorine/pull/251

fabrao 2021-05-11T14:27:29.132300Z

is 0.11.2 available?

mauricio.szabo 2021-05-11T14:27:44.132600Z

Not yet, just waiting for the CI to run

fabrao 2021-05-11T14:28:30.133200Z

with this, I think I can manage many repls as I want, thank you

mauricio.szabo 2021-05-11T14:29:15.133800Z

yes, but you still can only be connected in one at a time, but at least it's easier to switch between them

fabrao 2021-05-11T15:45:14.134300Z

is it will take too long? ๐Ÿ™‚

mauricio.szabo 2021-05-11T15:45:27.134500Z

It's published now

fabrao 2021-05-11T15:46:02.134900Z

ahahahahaha, I saw it now ๐Ÿ˜ฑ

fabrao 2021-05-11T15:46:44.135300Z

Iยดm checking it now

fabrao 2021-05-11T15:48:00.135600Z

worked !!!

fabrao 2021-05-11T15:50:08.136Z

why didnยดt you expose the disconnect?

fabrao 2021-05-11T15:53:55.136500Z

my happiness took only 5 minutes ๐Ÿ˜ž

mauricio.szabo 2021-05-11T15:55:14.137Z

Because you can run it without needing to be exposed

mauricio.szabo 2021-05-11T15:55:17.137300Z

atom.commands.dispatch(atom.views.getView(atom.workspace.getActiveTextEditor()), 'chlorine:disconnect')

mauricio.szabo 2021-05-11T15:55:43.137800Z

(replace 'chlorine:disconnect' or any other command from Chlorine or any other package)

fabrao 2021-05-11T15:56:47.138100Z

ohhhh

fabrao 2021-05-11T16:05:48.138600Z

# This waits for the package to load
atom.packages.activatePackage('chlorine').then (pkg) ->
  # This picks up the "main module" of the package
  Cl = pkg.mainModule
  
  # Conectar sem pop-up
  atom.commands.add 'atom-text-editor', 'fabrao:connect-direct', ->
    editor = atom.workspace.getActiveTextEditor()
    atom.commands.dispatch(atom.views.getView(editor), 'chlorine:disconnect')
  	Cl.connect_socket 'localhost', 5555
What am I doing wrong?

mauricio.szabo 2021-05-11T16:07:20.139100Z

What's happening, exactly? Some error, or the command does not appear on the command pallete?

fabrao 2021-05-11T16:10:03.140500Z

Cl is not defined -> after evaluate , but if I run it, only disconnect, not connect

fabrao 2021-05-11T16:10:27.140900Z

is it an async process?

mauricio.szabo 2021-05-11T16:11:48.141500Z

BTW, I think all commands on Atom are async, so you may have to await a little bit for everything to get settled up. Maybe something like:

atom.packages.activatePackage('chlorine').then (pkg) ->
  # This picks up the "main module" of the package
  Cl = pkg.mainModule
  # Conectar sem pop-up
  atom.commands.add 'atom-text-editor', 'chlo:connect-direct', () ->
    editor = atom.workspace.getActiveTextEditor()
    atom.commands.dispatch(atom.views.getView(editor), 'chlorine:disconnect')
    setTimeout(
        -> Cl.connect_socket 'localhost', 5555
      , 200
    )

mauricio.szabo 2021-05-11T16:12:14.142100Z

(I have no idea if the setTimeout syntax is right... too much time without having to handle coffeescript, thankfully)

mauricio.szabo 2021-05-11T16:20:39.142500Z

Fixed the syntax

fabrao 2021-05-11T16:21:07.142800Z

I was trying to fix it

fabrao 2021-05-11T16:21:46.143Z

is it worked for you?

mauricio.szabo 2021-05-11T16:42:48.144300Z

Ok, did another fix on the script. the -> needs an extra space so setTimeout will undestand that 200 is the second parameter, and not part of Cl.connect

mauricio.szabo 2021-05-11T16:43:31.145100Z

BTW, I highly suggest you to rename your init.coffee to init.js and use Javascript only... CoffeeScript is terrible because of these small issues

seancorfield 2021-05-11T16:48:26.146Z

I was certainly very happy to remove as much of my init.coffee as possible and switch over to the config.cljs that Chlorine uses for customization ๐Ÿ™‚

fabrao 2021-05-11T17:33:50.146600Z

is that possible to use all those scripts in config.cljs?

metehan 2021-05-11T18:26:07.148400Z

hi I am "r" ๐Ÿ™‚

2๐Ÿ‘‹
mauricio.szabo 2021-05-11T18:26:11.148600Z

@fabrao not really. config.cljs is mostly a way to configure evaluations results and other things. It relies on some state that only exist when you're connected to a REPL, so that's why it's not (yet) possible ๐Ÿ™‚

mauricio.szabo 2021-05-11T18:29:16.150600Z

@m373h4n we were talking about clojerl over the meetup. I think that the latest version of Clojerl (0.7.0) have a bug on the Socket REPL implementation, so you may want to use the master branch. If you use rebar3 to start your Clojerl project there's a config to use the branch instead of the version

metehan 2021-05-11T18:35:27.151200Z

thank you for the tip I'll use the master branch ๐Ÿบ๐Ÿ™‚

mauricio.szabo 2021-05-11T18:35:53.151500Z

Nice, any problems ping me ๐Ÿ™‚.

metehan 2021-05-11T18:36:49.151900Z

ofc I'll ๐Ÿ™‚ very nice beard btw I like it ๐Ÿ˜„

1