parinfer

shaunlebron 2018-08-22T03:43:30.000100Z

> pressing backspace at the beginning of the next line should fix it. parinfer exposes tabstop locations for this reason

shaunlebron 2018-08-22T03:44:11.000100Z

e.g. in atom, pressing shift-tab will fix it, but backspace can be made to do likewise

shaunlebron 2018-08-22T03:45:57.000100Z

> we don’t have access to the metadata about how certain forms should be indented. Which I wonder about what we could do if we pass that to parinfer. I want to resist the pressure to turn parinfer into an auto-formatter

shaunlebron 2018-08-22T03:46:50.000100Z

there’s a lot of config for indentation options: https://github.com/clojure-emacs/clojure-mode#indentation-options

shaunlebron 2018-08-22T03:47:40.000100Z

> many cases aren’t ambiguous, and even if it worked conservatively (didn’t do anything weird in ambiguous cases), it would be neat. I’m willing to look at cases if they’re laid out

shaunlebron 2018-08-22T03:51:09.000100Z

I suppose you’re right that stickiness may not be that annoying

shaunlebron 2018-08-22T05:28:36.000100Z

https://i.imgur.com/3xHXl4I.gif

1😮
onetom 2018-08-22T08:40:26.000100Z

@pez where is the source code for that version of the extension u uploaded? just want to make my team mates not worried about installing some trojan 😉

pez 2018-08-22T08:50:55.000100Z

@onetom it's this repo: https://github.com/shaunlebron/vscode-parinfer

pez 2018-08-22T08:51:28.000100Z

master from that repo, even.

1
pez 2018-08-22T09:01:47.000100Z

Please note that it is not super smooth yet. Parinfer relies on that its editing commands are always carried out by the editor, which it seems the extension does not yet manage to get vscode to do as always as is needed. And sometimes it stops you from undoing, which can be a bit frustrating. What I do is that I toggle parinfer off when this happens, undo, and toggle it on again. And if your colleagues are using Calva, you should also know this: https://github.com/BetterThanTomorrow/calva-fmt#parinfer-and-auto-adjust-cursor-on-new-lines

onetom 2018-08-22T09:10:50.000100Z

Thanks. I got the message about the calva-fmt indentation issue when u mentioned earlier. What do you mean by "if your colleagues are using Calva"? What else would they use? Or I should rather ask what else should they use, since I'm just trying to get CLJS adopted in the company.

pez 2018-08-22T09:11:36.000100Z

I think they should use Calva, but I am biased. 😃

onetom 2018-08-22T09:11:46.000100Z

I'm using Cursive and my other colleague use doom emacs and others use vs code

pez 2018-08-22T09:12:53.000100Z

Those who use Cursive and Emacs should stick too those. Even as biased as I am, I will say that. But for vscode I think Calva is the best so far, especially for CLJS.

onetom 2018-08-22T09:31:15.000100Z

so im actually having a hard time using it... so i have this monorepo: https://gitlab.com/oax/state-channel-poc/ but the cljs project is in one of the subdirectories: https://gitlab.com/oax/state-channel-poc/tree/master/viz/states

pez 2018-08-22T09:32:08.000100Z

Hard time using Calva?

onetom 2018-08-22T09:32:12.000100Z

and my nREPL setup is using nrepl/nrepl with clj -m nrepl.cmdline

onetom 2018-08-22T09:32:54.000100Z

yeah... it seems it was designed to be used with lein repl :connect from the top-level of a project...

onetom 2018-08-22T09:34:34.000100Z

if it's just using the built-in vscode terminal, i would have expected it to be able to just control an exiting one started manually...

pez 2018-08-22T09:35:31.000100Z

There is definitely an unnecessary dependency on lein there, that I should fix. But there is a setting for telling Calva where the project root is. Let me check…

onetom 2018-08-22T09:36:19.000100Z

well... there might be multiple clojure projects within this repo, since it's a monorepo...

onetom 2018-08-22T09:36:52.000100Z

but i just saw in the calva readme under the "future stuff" section: > Open as many REPLs as you like. so i guess it's unsupported indeed...

onetom 2018-08-22T09:38:15.000100Z

in the meantime i will try what happens with a lein repl client

onetom 2018-08-22T09:39:23.000100Z

ah, i just realized that you are the main developer of calva 🙂 thanks for helping out!

pez 2018-08-22T09:39:36.000100Z

Well, I haven't considered monorepos at all, other than noting that I myself do not use the calva.projectRootDirectory setting but rather open separate vscode windows in a repo at work where there are several projects (don't know if it qualifies as a monorepo)..

pez 2018-08-22T09:40:34.000100Z

Unfortunately I am more like the only developer. But it seems that might be improving.

pez 2018-08-22T09:42:42.000100Z

If you have the time I would be happy to get an issue filed against the Calva repo where you described the monorepo needs and maybe how you think Calva should support it.

pez 2018-08-22T09:44:52.000100Z

> if it's just using the built-in vscode terminal, i would have expected it to be able to just control an exiting one started manually... Not sure I follow here, but currently Calva opens its own Terminal sessions in the built on one to be able to control them (even if limited). I don't think there is a way to get a handle to a user created terminal.

onetom 2018-08-22T09:51:46.000100Z

i don't think i can recommend any solution until i familiarize myself more with vs code. i was hoping i can switch to it from intellij because vscode feels a bit faster and less resource hungry, but so far it feels quite inferior compared to jetbrains ides feature wise 😕

onetom 2018-08-22T09:52:42.000100Z

re: terminal: i think i got what you mean

pez 2018-08-22T09:52:51.000100Z

Well, you could describe how Cursive helps with it, maybe?

onetom 2018-08-22T09:53:45.000100Z

cursive have the concept of modules within a project, but that's quite a heavy concept and i don't think it fits well with the philosophy of vscode

pez 2018-08-22T09:55:38.000100Z

Fair enough. I'll have to read up some on monorepos. Might holler your way when I try to figure out how to better support it. Seems like you have already given me a clue with that just opening REPLs at will would help.

onetom 2018-08-22T09:56:13.000100Z

I would be very happy to discuss monorepos and their benefits and issues with you, btw

onetom 2018-08-22T09:56:54.000100Z

I'm a proponent of them in the past 2-3 years and in 3 different companies my experience was that their benefits far outweigh their drawbacks

onetom 2018-08-22T09:57:55.000100Z

if you want to build a CI pipeline for a monorepo, you definitely want to have this kind of optimization to compute which subproject has changed in it: https://github.com/awesome-inc/monorepo.gitlab

onetom 2018-08-22T09:58:34.000100Z

then this is a great analysis of the concept: http://danluu.com/monorepo/

onetom 2018-08-22T09:59:16.000100Z

i think it was one of the first articles i've found about this concept. i actually started to use monorepos before i knew that they are a thing and they have a name...

pez 2018-08-22T10:00:24.000100Z

Haha, I was just about to post that link to ask you if it was a good starting point. 😃

onetom 2018-08-22T10:00:45.000100Z

since then there are a lot more experience reports about them and here is an important one, which might instil confidence in others already based on its URL: https://trunkbaseddevelopment.com/monorepos/

pez 2018-08-22T10:01:21.000100Z

Thanks!

pez 2018-08-22T14:36:42.000100Z

Btw, vscode has some concept of multiproject workspaces that I haven't looked very deeply at. However, it rather seems to be the opposite; a way to create a mono-workspace from multiple repos.

onetom 2018-08-22T16:23:24.000100Z

now that you are saying, i've also seen that feature when i was going thru their changelogs the other week

onetom 2018-08-22T16:24:25.000100Z

but indeed, it's the opposite of the monorepo case

shaunlebron 2018-08-22T19:43:43.000100Z

implemented some elastic tabstop functions to see how it works: https://beta.observablehq.com/@shaunlebron/elastic-tabstops

shaunlebron 2018-08-22T20:23:45.000100Z

it might be a bit much to expect clojure users to start using tabs in source files

shaunlebron 2018-08-22T20:24:32.000100Z

unless inferring tab characters from existing files to provide a guess becomes reasonable

shaunlebron 2018-08-22T20:25:43.000100Z

either way, was nice to study this to get a better idea of the space that both tools occupy