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
2021-02-01T17:48:55.012300Z

Hello! Trying to interact with Clover on VSCode, also installed clj-condo linter. But can not found any formatter, which can format inside the current block only and by pressing customisable hotkey or Tab. What you can suggest?

seancorfield 2021-02-01T17:51:45.013Z

@ivana I use Strict Paredit with VS Code to do indentation but I'm not entirely happy with it.

2021-02-01T17:53:06.014200Z

@seancorfield thanks alot, but I'm not use any structural editors

seancorfield 2021-02-01T17:53:54.015Z

I can't imagine working with Clojure without structural editing support... πŸ‘€

2021-02-01T18:17:57.017Z

Tried not recent calva-fmt and it works standalone, recommend it for par<...>-agnostics πŸ™‚

mauricio.szabo 2021-02-01T18:41:08.017400Z

Yes, unfortunately Clover do not add any "additional functionality" like linters or formatters... I'm not really a VSCode user so I don't know πŸ˜„

mauricio.szabo 2021-02-01T18:45:24.021100Z

But I believe that other plug-ins will work better as formatters / linters on VSCode. I tried to hack a "parinfer-rust" implementation for VSCode (that could double as a formatter) but ran into lots of problems and API limitations really fast... 😞

seancorfield 2021-02-01T18:47:28.021900Z

Paredit and Parinfer both seem to hit limitations with VS Code -- they both behave differently to similar extensions for Atom, unfortunately.

pez 2021-02-01T19:10:21.023Z

I don't think paredit should run into any vscode limits?

seancorfield 2021-02-01T19:26:36.023900Z

Auto-indent when pressing enter does not seem to work the same in VS Code as in Atom @pez -- at least for the standalone Paredit extension.

seancorfield 2021-02-01T19:27:01.024500Z

I believe you have a variant of it bundled into Calva? Maybe that is functionally different to the standalone version.

borkdude 2021-02-01T19:27:29.025200Z

I think Calva is indenting using cljfmt, which threw me off a couple of times, coming from (and still mainly abiding in) emacs

borkdude 2021-02-01T19:31:33.025600Z

(https://calva.io/formatting/)

borkdude 2021-02-01T19:33:05.026400Z

(I mean "threw me off" in the sense of: didn't do what I expected and thus confused me, not sure if that's the intended meaning)

clyfe 2021-02-01T20:39:06.035300Z

For folks that find it hard to paredit I propose "baby paredit" made of: β€’ paredit movement (`ctrl+arrow`, jumps s-exps instead words) β€’ normal selection (`ctrl+shift+arrow`, also used as movement fallback, ie. move via selection when paredit movement gets frustrating) β€’ Alt+d paredit kill to clipboard - the one true command, used for: deleting (clipboard is overwritten), cutting (duh), copy'ing (extra undo needed). It's basically cut - but I use it for all the above, and so can you. β€’ Some improvements to backspace such that it deletes directly to positions of interest (no intermediary spaces deletion). This is available via Calva + my https://github.com/clyfe/calva-extras extension bits + my https://github.com/clyfe/vscode-calva-setup/ settings. But otherwise, the ideas stand and can be configured on other tools too, and offer a leaner transition path to pro paredit (I'm not there yet myself).

seancorfield 2021-02-01T20:58:42.036400Z

I think wrap-with-paren/brace/bracket and slurp/barf are the things I use most in paredit.

clyfe 2021-02-01T21:07:12.038800Z

I do everything with Alt+d & don't use anything else πŸ™‚ (but I want to expand). wrap = position-to-start Alt+d paren paste;

pez 2021-02-01T21:32:08.039Z

I don’t know how it works in Atom and also which standalone version you are using. πŸ˜ƒ In Calva there is a Paredit and a formatter. Autoindent on enter is performed by the latter.

pez 2021-02-01T21:41:25.042500Z

Then the autoindent you see is probably performed by Parinfer.

pez 2021-02-01T21:43:42.044700Z

It has been suggested that we give Calva an option to surface only its static features (clojure-lsp things, syntax highlighting, formatting, paredit). https://github.com/BetterThanTomorrow/calva/issues/1005 I think that would make it half decent to use it side-by-side with Clover, Until we find the time to finish the work with separating out these things again, at least. Is that of interest to you Clover users?

seancorfield 2021-02-01T21:56:49.044900Z

Toggling the key map debugger, it seems like nothing is bound to Enter so I'm getting the default VS Code behavior. I guess that in Atom, with Paredit or Parinfer, plain old Enter is bound to some sort of insert-newline-and-indent which isn't provided by either of those in VS Code.

seancorfield 2021-02-01T21:58:36.046100Z

@pez Getting all of the Calva goodies that don't relate to code eval/REPLs alongside Clover's Socket REPL eval stuff sounds like a "win" to me.

πŸ‘ 1
2021-02-01T22:20:23.058Z

I'm not very happy of Clover REPL integration (as I see, it even can not show result near the cursor at form, just in separate window only), but I had to switch off from Calva and didn't find any usable REPL-plugin yet, maybe it is time to think about creating my own. But for now it seems, that 3 main fearures I need are: β€’ linter - there are a lot of them, but clj-condo is good, and seems that Calva also uses it, and it works standalone. Thanks @borkdude for solving this users point without any problems for them! β€’ formatter - I still use early build of Calva-fmt. I tried cljfmt, but didn't find how to format block via hotkey in VSCode. Maybe one time someone creates a wrapper for it to more convinient usage as a standalone plugin. β€’ REPL integration - Clover for now, though it is very limited even as this task solver, but I also didn't find any better solution for now. β€’ structural editors, lsp, debugger, rocket science and other stuff fortunatelly not needed for me πŸ™‚

pez 2021-02-01T22:22:36.059300Z

Probably. An extension can also implement an on type provider and do the formatting there. (Calva does it that way).

borkdude 2021-02-01T22:23:33.060300Z

There is also another nREPL based plugin which is the most popular vscode extension related to clojure, but the development of it doesn't seem to be very active. I haven't used it, but may be worth a try, if you can tolerate nREPL (I know, some prefer socket REPL, others nREPL)

borkdude 2021-02-01T22:25:05.061300Z

It would be nice if one could mix and match their own preferences, either by a plugin which is configurable, or by multiple plugins that do less. But multiple plugins often come with more overhead.

borkdude 2021-02-01T22:25:19.061600Z

yeah, that one

2021-02-01T22:27:00.063400Z

I tried it, and it can show result near the evaluated form (opposed to Clover), but have limitations in other things, or maybe I had to try it more active ) I'l try is one more time )

2021-02-01T22:37:17.068100Z

And about multiple plugins - as I remember, there is such a thing, like UNIX philosophy - it is better to have 10 functions, each one do its own local task, but do it well, than have 2 functions with a lot of settings & defaults πŸ™‚ So maybe this way have a chance?

borkdude 2021-02-01T22:39:04.069Z

@ivana clj-kondo uses a JVM (currently, in VSCode, running as an LSP server). other tools might also spawn a JVM. If you use 10 plugins you might have 10 JVMs while they could be running in only one, if it was configurable.

2021-02-01T22:42:36.071800Z

Yep, everything has its own cost, as usual. And there is no silver bullet yet. If one solution was much better than another, everyone would use it only (sorry for possible mistakes in that hard conditional 2-form or how it calls πŸ™‚)

seancorfield 2021-02-01T22:53:34.075Z

@ivana I agree that losing inline result display (compared to Chlorine for Atom) is unfortunate but my "workaround" for that is to run Reveal as a visualization tool for REPL results -- see my recent talks online to Clojure Provo and London Clojurians for what that looks like. I find that Reveal offers a lot of value above and beyond what Clover/Chlorine offer in their REPL output that I typically don't even have the REPL panel visible in VS Code now and just rely on Reveal (except for occasional syntax errors where I still need to quickly switch to the REPL tab and back).

2021-02-01T22:56:42.076200Z

@seancorfield sounds very interesting and promising! I'l look at your stream about it.

seancorfield 2021-02-01T23:04:33.076300Z

I link to both recordings from this blog post https://corfield.org/blog/2020/11/24/talks-clojures-superpower/

πŸ‘ 1
βœ… 1
2021-02-01T23:11:32.077Z

For the first look it reminds me my watch/inspect always-on-top windows in my simple bicycle-like debugger I played with 2 years ago https://github.com/Ivana-/bb-debug

seancorfield 2021-02-01T23:24:26.077300Z

https://vlaaad.github.io/reveal/ More info about Reveal.