[OPEN SOURCE] LuaRaiter | Function documenter. Comment format


Download version 0.71

LuaRaiter.lua (17.6 KB)


Introduction

Hi all!
This is a plugin for automatic code documentation. When you run it, it indexes and opens all your scripts and creates a comment template for their functions. The template needs to be filled in with your description. All indexed functions are stored in the plugin’s search engine. The search engine shows where the function is located and displays its description. And most importantly allows you to search for a function by its description.

I’ve spent some time thinking about what format function comments should have. And why. Any - unless there’s a program that allows you to interact with the comments in some way.

ScrAvaPlugin


And I thought that I could offer such a format, and a plugin for it. I’m not saying it’s an ideal commenting format, and perhaps you could make some changes. But for now it’s something like this.

Who is it for and why?

For you in the first place. When you have more than 1k functions in a project, you can get confused. If you work in a team, you will have a standard of comments. If a new person joins the team, he or she will at least be able to find functions from the description.
If you’ve been putting off the day when you comment on all the features, it will be more fun with the plugin, and - now.


Watch out!

This is the alpha version of the plug-in. And it may mess up some of the features in your scripts! Check how the plugin works in drafts!


Install

  1. Install the PluginReact in your project. Version 1.33 or higher. (This library allows you to create input fields, buttons and blocks in the style of Roblox Studio editor. )

  2. Copy the file LuaRaiter.lua into the plugins folder

  3. Open the plugin and click “Scaning project”. The plugin will find all the scripts in your project, and enter a comment template for each function. You will then receive a report on the number of functions.
    If this is your first launch. Press “Scanning project” again. To get the scripts into the explorer.

  4. Go to the Explorer tab. Here you can find your functions.

  5. Open your scripts and write a couple of comments instead of “The defult description”. Then re-scan the project and you can find your function by description in the Explorer tab.



Video

The video shows me scanning a project and comments appear.



In the futureI’ll be there.

-I will definitely be updating this plug-in. As there is a need to comment on the code. And we often work as a gang in scripts.

-Working with function arguments. They must be displayed in the explorer.

-Work on translating the plugin. I am currently using Deepl translator. And I hope to be understood.

-Recalculating the commenter rating. Perhaps the volume of the comment will be taken into account.

-Tab - “Recall function”. This tab always displays a random function without a comment to describe. This would make it more interesting to document the project lol



And so.

If you have any ideas on how to make it more convenient. Or maybe use a different comment format. Write.

If, after scanning the project, your feature breaks - give feedback! I haven’t had this happen for several versions, but I’m sure it’s possible.

11 Likes

Very cool!
I was going to write something similar to this, so I took some time to mess around with this.

Here are two minor bugs I’ve found that breaks the system:

  1. There’s a uncommon/unknown method of writing strings or comments
exampleString = [==[hey this is a string]==]

example2String = [=========[hey this is also a string]=========]

--[========================================================================[

        you can put any number of equal signs, 
        so long as it's the same amount on the top and bottom.

        all of this counts as a comment

]========================================================================]

  1. This is technically valid lua, but it breaks LuaRaiter
function
	--[[hey]]anotherAlsoWrittenFunny()

end

Overall, code is not commonly structured in the ways shown above, so these are very minor issues.
I appreciate you making this open source!

If you want an easier (though probably unnecessarily more computationally expensive) method of solving the issues listed above, I recommend using a Lexer module, like the one originally made by sleitnick and improved by boatbomber. (That’s what I might do for my own project, since I don’t want to bother too much with string manipulation)

2 Likes

Whoa! That’s the kind of syntactic banter I was expecting xD
I don’t even know how I managed to miss the inverted commas.
Thank you! I’ll add that to the new version!

About the navigation module. Don’t want to use third party solutions yet. It takes a lot of practice in parsing data to support such a plugin - and I’ll get it :slight_smile:

2 Likes