Motoko Code Formatter

Hi, I was looking through available vs code extensions for Motoko but I only managed to find a formatter for imports.

How do you guys format your code, pure tabs?

Likely developing VS Code Extensions for Motoko and ICP could be the basis of an objective of a developer grant.

We already have one! ICDevs.org - Bounty #11 Language Server Updates - $3750+

3 Likes

To be honest I think the prize is pretty low taking into account the amount of work required. No one sane would code it for that bounty. It is in everyone interest that we have a code formatter in order to get more adoption, make it 10x, it’s worthy.

2 Likes

Having done some work towards it, I agree with that assessment.

2 Likes

How would you describe your progress based on the remaining work? :-s

I’m not working on it but I did some work to help get it started.

See src/js/mo_prettier.ml

1 Like

Nice, appreciate your work. Hopefully we’ll get a full timer on this one.

What is an attractive amount?

By random googling, the average senior software developer makes around 70$/hour, multiply this by x hours, I won’t give an accurate estimate myself as I barely started learning the language and writing code formatters is not something that I’ve done in the past. But I would not think that someone could do it under 200 hours. So anything under 14k imho would be just not fair and who will do it would do it out of pure passion, that could take another year or two. Idk, in most of the cases, formatters are something that come out organically from the communities and I don’t wanna emphasize the idea of just pumping money into it if there is no actual demand. But I do believe this is a big quality of life improvement that could use a bigger kickstarter.

I’ve thought of breaking it into smaller chunks with significant increases across the feature set…but I need the features list and I don’t know language servers at all. Pull requests welcome. I know I want a goto declaration. :100:

2 Likes