Fork me on GitHub
#parinfer
<
2018-08-22
>
shaunlebron03:08:30

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

shaunlebron03:08:11

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

shaunlebron03:08:57

> 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

shaunlebron03:08:40

> 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

shaunlebron03:08:09

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

onetom08:08:26

@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 😉

pez08:08:28

master from that repo, even.

4
pez09:08:47

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

onetom09:08:50

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.

pez09:08:36

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

onetom09:08:46

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

pez09:08:53

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.

onetom09:08:15

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

pez09:08:08

Hard time using Calva?

onetom09:08:12

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

onetom09:08:54

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

onetom09:08:34

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...

pez09:08:31

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…

onetom09:08:19

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

onetom09:08:52

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...

onetom09:08:15

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

onetom09:08:23

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

pez09:08:36

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)..

pez09:08:34

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

pez09:08:42

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.

pez09:08:52

> 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.

onetom09:08:46

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 😕

onetom09:08:42

re: terminal: i think i got what you mean

pez09:08:51

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

onetom09:08:45

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

pez09:08:38

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.

onetom09:08:13

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

onetom09:08:54

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

onetom09:08:55

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

onetom09:08:34

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

onetom09:08:16

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...

pez10:08:24

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

onetom10:08:45

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/

pez14:08:42

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.

onetom16:08:24

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

onetom16:08:25

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

shaunlebron19:08:43

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

shaunlebron20:08:45

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

shaunlebron20:08:32

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

shaunlebron20:08:43

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