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 2020-04-09T01:11:22.104300Z

Is there any way to hook saving file and call chlorine:clear-inline-results after that?

fabrao 2020-04-09T01:11:30.104500Z

in atom?

mauricio.szabo 2020-04-09T01:16:07.106800Z

I believe you can do it using the init.js script. You can listen to text editors, listen to some callbacks, and so on. You probably want atom.workspace.observeTextEditors: https://flight-manual.atom.io/api/v1.45.0/Workspace/#instance-observeTextEditors

mauricio.szabo 2020-04-09T01:16:40.107700Z

And when this calls back, you register another callback: https://flight-manual.atom.io/api/v1.45.0/TextEditor/#instance-onDidSave

fabrao 2020-04-09T01:16:46.107800Z

or you include an option that "Clean evaluates after save"

fabrao 2020-04-09T01:16:54.108Z

πŸ™‚

fabrao 2020-04-09T01:20:14.108500Z

are you going to replace init.js after update?

mauricio.szabo 2020-04-09T01:20:51.109400Z

init.js (or init.coffee) is a file that's user-specific

fabrao 2020-04-09T01:21:00.109800Z

oh , sorry init.js is for atom not chlorine

mauricio.szabo 2020-04-09T01:21:38.110600Z

Yes, the atom specific πŸ™‚

fabrao 2020-04-09T01:32:09.111100Z

something like

atom.workspace.observeTextEditors (editor) ->
    editor.onDidSave () -> atom.commands.dispatch(atom.views.getView(editor), 'chlorine:clear-inline-results')
?

seancorfield 2020-04-09T01:43:49.112700Z

I think a workflow based on actions-on-save is flawed. I work without saving code a lot. I evaluate code as I write it and change it. I run tests too without saving changes. I clear inline results when I want. I save when I want -- and don't want any magic happening at that point.

seancorfield 2020-04-09T01:44:14.113300Z

I think people need to get away from save-watch-run style workflows.

seancorfield 2020-04-09T01:44:28.113700Z

But I'm very opinionated about workflow πŸ™‚

seancorfield 2020-04-09T01:45:03.114700Z

(luckily with Atom you can customize this any way you want but...)

fabrao 2020-04-09T01:45:23.115100Z

Yes, but once you evaluate, evaluate, evaluate it become very anoying and messy

fabrao 2020-04-09T01:45:51.115500Z

in Cider you only press ESC and done

fabrao 2020-04-09T01:46:47.116300Z

so, this is adapt that guy from Emacs

fabrao 2020-04-09T01:46:53.116500Z

πŸ™‚

seancorfield 2020-04-09T01:54:50.117500Z

I find it very helpful to keep all those inline results around until I decide to get rid of them. I'd hate them all to vanish if I accidentally saved a file in the middle of some work! :rolling_on_the_floor_laughing:

seancorfield 2020-04-09T01:55:20.118100Z

I used Emacs for years (technically decades). I've never looked back since I switched to Atom tho' ...

fabrao 2020-04-09T02:05:56.118600Z

IΒ΄m in transition of it !!! πŸ™‚ Cider is very very good

fabrao 2020-04-09T02:07:44.119300Z

and the best tool for Clojure is clj-refactor

fabrao 2020-04-09T02:08:00.119500Z

have you ever used it?

fabrao 2020-04-09T02:09:09.120200Z

I think we can implement any kind of functions inside it in Atom

fabrao 2020-04-09T02:11:01.120600Z

like you did in sean:... to use with rebl

seancorfield 2020-04-09T03:03:08.121500Z

I've never felt a need for any automated refactoring tools.

seancorfield 2020-04-09T03:03:34.121900Z

I think people rely too heavily on "tool support".

seancorfield 2020-04-09T03:04:25.122900Z

Watch Stu Halloway's talks on "Running with Scissors" and "REPL-Driven Development". Watch Eric Normand's excellent course on REPL-Driven Development.

seancorfield 2020-04-09T03:05:06.123600Z

It's the "Java disease" where people rely so heavily on IDE support that they no longer know how to write code in a plain editor.

fabrao 2020-04-09T03:17:54.125300Z

I think in the way that the tool (IDE, editor, refactor ...) gives you support to do things that you think less to be more productive

seancorfield 2020-04-09T03:21:52.127200Z

I disagree -- I believe that "thinking less" is a mistake. Fully understanding your (basic) tools is important. IDEs and refactoring tools lead to more "magic" and less "understanding". People who rely on them stop being able to do those actions without tooling support. Digital amnesia http://amnesia.kaspersky.com/

seancorfield 2020-04-09T03:22:27.127700Z

(it's more widespread than just smartphones)

fabrao 2020-04-09T03:27:37.130200Z

but if you think like clj-refactor helping me to organize :require stuffs that I included and clean that I do not use is very useful for me, thatΒ΄s the way I mean about "thinking less" or "left using manual stuffs"

fabrao 2020-04-09T03:30:19.132700Z

like you said "(luckily with Atom you can customize this any way you want but...)", in this case doing stuffs that can help me to be more productive, and the tool can be anything that you been conformtable

mauricio.szabo 2020-04-09T03:32:34.136900Z

There are some feature that I'm planning to support from cider. In order of my personal preference are orchard extensions for documentation and goto var definition, hotload dependencies, organize ns, debugger and refactor. But the thing with Chlorine is: it'll never inject anything on the classpath. So, it'll use these features if they are present. If not, there will always be a "default option"

mauricio.szabo 2020-04-09T03:36:44.138Z

I remember one job in Clojure where people used mostly Intelij. The editor hide imports, adds and removes then at will, and also adds aliases for you. Some files imported 80 namespaces, and lots of test files had syntax errors (load file didn't work, but for some reason running tests worked fine). Also, some aliases were completely impossible to decipher - things like a-tx-inc-ml were common

mauricio.szabo 2020-04-09T03:37:42.138200Z

As most people had a tool that organized these things automatically, people were used to not look at the namespace declaration and think "maybe we're importing too much..."

seancorfield 2020-04-09T03:39:39.139100Z

What I do use is a real-time linter (`clj-kondo`) that prevents me from making a lot of mistakes that would need to be refactored later πŸ™‚

πŸ‘ 1
seancorfield 2020-04-09T03:40:44.139300Z

I hate IDEs for that exact reason 😞

fabrao 2020-04-09T03:48:11.139900Z

IΒ΄ve never used linter

2020-04-09T04:02:09.141200Z

i hadn't used a linter much until clj-kondo, but it's near real-time capability completely changed my opinion of the worth of such a thing. to be informed while context is still fresh in one's mind is invaluable imo.

mauricio.szabo 2020-04-09T12:32:32.154900Z

I only used Joker so far, mostly because it was already installed (because it is also an interpreter with socket-repl support), but I'll try clj-kondo after this thread πŸ˜„

πŸ‘ 1
seancorfield 2020-04-09T16:16:23.155400Z

There's a linter-kondo package to wire up Atom to the command line clj-kondo command. Works well. Pity it only supports warning/error levels, not info.

seancorfield 2020-04-09T16:57:22.155600Z

I just double-checked the source code and linter-kondo isn't at fault here -- clj-kondo itself only produces a non-zero exit code for warning/error levels and that's what triggers the linter to decode/display the summary results.

2020-04-09T04:04:01.143300Z

i'd like to add a point to the refactoring discussion -- i have heard these types of discussions multiple times, but have always left feeling they tended to remain abstract. i think if concrete cases were discussed it would be much more enlightening to all parties involved. especially in the realm of cs / it, people seem to have very different notions of terms.

fabrao 2020-04-09T04:05:03.143600Z

Ohhhh πŸ˜€

seancorfield 2020-04-09T04:17:08.144800Z

I like that I can configure clj-kondo a lot: I've made unsorted requires an error πŸ™‚

2020-04-09T04:17:26.145200Z

ah, that's interesting to hear. is there somewhere i might read up on some of those details?

seancorfield 2020-04-09T04:17:37.145500Z

And Borkdude is so responsive and works so hard to make it better all the time.

seancorfield 2020-04-09T04:17:47.145600Z

What do you mean?

2020-04-09T04:18:12.146100Z

indeed, those are definitely important points!

seancorfield 2020-04-09T04:18:20.146200Z

Joker only does a small subset of what clj-kondo does.

2020-04-09T04:19:15.146400Z

ah ok -- i had never used joker, so i didn't know. so perhaps part of it is that clj-kondo manages to overcome a certain threshold of usefulness for enough people.

seancorfield 2020-04-09T04:20:07.146600Z

Joker does basic unused requires and unused bindings stuff and local arity checking. Useful enough to be worthwhile.

seancorfield 2020-04-09T04:20:25.146800Z

But until recently I had no idea how much stuff clj-kondo did.

seancorfield 2020-04-09T04:20:52.147Z

I finally decided to try it out... and switched immediately... and committed a .clj-kondo/config.edn to the repo at work! πŸ™‚

2020-04-09T04:21:25.147700Z

great! i found it a bit overwhelming to configure, so i haven't tuned it -- except for one case where i was using it programmatically and needed to turn off all of the linting.

seancorfield 2020-04-09T04:21:36.148100Z

Part of why I'm so passionate about Chlorine is because @mauricio.szabo is so responsive and proactive. The same is now applying to clj-kondo too.

πŸ˜„ 1
2020-04-09T04:22:46.149300Z

i agree, @mauricio.szabo has been (and continues to be) great! it would be nice if this were true of more projects, but it is not so easy.

πŸ˜„ 1
seancorfield 2020-04-09T04:23:35.150Z

As someone who maintains a bunch of projects, yeah, it's definitely hard to be that responsive and that proactive!

2020-04-09T04:24:55.150800Z

i often wonder if it wouldn't be helpful if there were a "successor" or "co-maintainer" in training. kind of like what the romans used to do πŸ™‚

seancorfield 2020-04-09T04:31:33.152800Z

For some projects, that naturally happens. I'm the third maintainer of tools.cli, the second for java.jdbc, the second for java.data and core.cache and core.memoize. The third for honeysql too I think? Maybe also clj-time. I was the second or third maintainer for congomongo and handed that off to someone else.

🦜 1
seancorfield 2020-04-09T04:33:06.153800Z

Not all projects deserve to live. Important projects always get new maintainers. If a project dies for lack of a maintainer, then it wasn't important enough to live.

2020-04-09T05:24:40.154800Z

it's nice when it works out, but i don't think it does all of the time.