This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-11
Channels
- # aleph (3)
- # announcements (3)
- # aws (7)
- # babashka (121)
- # beginners (82)
- # calva (40)
- # chlorine-clover (37)
- # clj-kondo (68)
- # cljsrn (4)
- # clojure (43)
- # clojure-australia (1)
- # clojure-dev (6)
- # clojure-europe (15)
- # clojure-italy (2)
- # clojure-nl (1)
- # clojure-provo (3)
- # clojure-spec (23)
- # clojure-taiwan (1)
- # clojure-uk (21)
- # clojurescript (214)
- # code-reviews (1)
- # conjure (4)
- # core-async (10)
- # cursive (52)
- # datahike (5)
- # datascript (5)
- # datomic (62)
- # duct (1)
- # emacs (4)
- # fulcro (8)
- # graalvm (1)
- # helix (1)
- # honeysql (5)
- # integrant (1)
- # jackdaw (32)
- # jobs (3)
- # jobs-discuss (16)
- # juxt (1)
- # kaocha (3)
- # lsp (6)
- # malli (2)
- # meander (6)
- # nrepl (1)
- # off-topic (46)
- # other-languages (4)
- # pathom (7)
- # polylith (13)
- # re-frame (3)
- # releases (2)
- # shadow-cljs (56)
- # spacemacs (15)
- # tools-deps (3)
- # unrepl (1)
- # utah-clojurians (1)
now I see there is something going to be connect!
in https://github.com/mauricioszabo/atom-chlorine/issues/94 . Sorry about that
Please see https://github.com/mauricioszabo/atom-chlorine/pull/251/files?short_path=46aca70#diff-46aca7079be2ef59a99745c7589744a1171129649b89add013cb0c6e1b2bd8b7, for instructions on how to use it 🙂
Not yet, just waiting for the CI to run
yes, but you still can only be connected in one at a time, but at least it's easier to switch between them
It's published now
Because you can run it without needing to be exposed
atom.commands.dispatch(atom.views.getView(atom.workspace.getActiveTextEditor()), 'chlorine:disconnect')
(replace 'chlorine:disconnect'
or any other command from Chlorine or any other package)
# 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?What's happening, exactly? Some error, or the command does not appear on the command pallete?
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
)
(I have no idea if the setTimeout
syntax is right... too much time without having to handle coffeescript, thankfully)
Fixed the syntax
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
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
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 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 🙂
@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
Nice, any problems ping me 🙂.