nikhilkalige / docblockr

DocBlockr is a package for Atom which is designed to make writing documentation faster and easier.
MIT License
405 stars 93 forks source link

Do some basic rust parsing of functions #352

Closed QuantumEntangledAndy closed 3 years ago

QuantumEntangledAndy commented 3 years ago

First off I apologise for my poor javascript. Not my native language.

Here I add a simple extension to add rust parsing of functions and formatting the output.

The formatted output tries to adhere to the format recommended by the rust book and the machine readable specs

Comments, suggests, outright crying over poor js code blasphemys are expected and encouraged.

Fixes: #331 Fixes: #347

QuantumEntangledAndy commented 3 years ago

I only seem to have it working on the docblockr:parse-tab command and not the docblockr:parse-enter, I am looking into it but suggestions would be welcome

QuantumEntangledAndy commented 3 years ago

Ok the reason 'extend_line': /^\s*(\/\/[\/!]?|#)/ for rust was not working in rust is because the scope is comment.block but the original code explicitly checked for comment.line I have pushed a fix on that too

MoritzKn commented 3 years ago

First of all, thanks for your time! Please be aware though: this package, as most of the atom eco-system, is unfortunately pretty much unmaintained. That being said if you are confident with your PR, I'd be willing to simply merge it. But if you need someone to review your work and/or help you with testing, you would need to find someone by yourself.

Please make sure that:

QuantumEntangledAndy commented 3 years ago

Yes I figured this might be unmaintained when looking at the commit histories. Just thought I'd share the changes that got it working for me.

QuantumEntangledAndy commented 3 years ago

@MoritzKn I've gone and added the specs and have improved the rust parser to match more edge cases. I think it should be ok to merge now if you want to give it a once over.

MoritzKn commented 3 years ago

Hi @QuantumEntangledAndy I was just getting ready to merge your PR. You've got to know I've literally didn't touch this repo in years. The thing is... the last person that worked on Docblockr was @Fluvf who did amazing work and a lot of cleaning up. I merged all of it into develop but we never got around to making a release or merging into master. So now we have a bunch of changes sitting in develop that I don't want to throw away.

The issue is if I merge your changes into master we can no longer merge develop. Would you mind rebasing (or merging) your changes against develop?

QuantumEntangledAndy commented 3 years ago

Sure I'll check out that branch and try a rebase. It's getting late where I am so that will have to be tomorrow now.

QuantumEntangledAndy commented 3 years ago

So I have a rebase ready do you want me to repoint this PR into the develop branch?

MoritzKn commented 3 years ago

Yes sure, you can change to the target branch. But I can do that too so it's not so important.

QuantumEntangledAndy commented 3 years ago

Ok done and ready

QuantumEntangledAndy commented 3 years ago

Ok I just saw that there was a new setting in develop that makes return and prameter doc string optional so I made a quick edit to include that in rust too :)

QuantumEntangledAndy commented 3 years ago

Awesome thanks for getting the merged :)

QuantumEntangledAndy commented 3 years ago

If you have any rusted related issues feel free to drop me an email or something

MoritzKn commented 3 years ago

I can't really believe it but after over 3 years I've actually just pushed a new release to the atom package registry, enjoy!

MoritzKn commented 3 years ago

That'd be awesome