Documenting code

When using built-in functions, both of core Lua and Roblox entities, you can see descriptions of how to use those functions including the expected argument types.
Is there a way to get modulescripts to have this?

I really think Roblox needs better support for object oriented programming, mainly more documentation on how to do OOP within Lua with techniques that are already possible.


What better support would it provide? There’s already resources available to implement it from, it’s not particularly complicated.


ModuleScripts as well as LocalScripts and regular Scripts all support intellisense.

Here is some help on OOP with LUA.

Are you talking about the small context scroll list that describes what a function does and the arguments list that bolds as you add arguments? No, you cannot have a ModuleScript do this. The intellisense will pick up on items of your ModuleScript so long as they’re returned on require, but you cannot use that documentation panel the way Roblox does.

1 Like

It’s not possible but definitely should be and would make life easier for a lot of us. The Roblox ‘intellisense’ equivalent is pretty basic but being gradually improved.

Something similar to JavaDoc would be cool.


Yeah in lua making a static object vs making an object with methods vs making a table with functions that operate on that table is VERY unclear. Would love examples of each working.

I feel a feature request coming on!

1 Like

What I think you are really wanting is a type system. Langues like C, C++, and Java have them, but scripting languages like python, lua, and javacript do not. These type systems provide mathematical guarentees of proper execution and if properly designed, restrict programs to their intended use. If improperly designed or writing an inuntended program, one will fight the type system. Type systems take time to design and maintain while scripting languages are meant to be quick and dirty get-er-done languages. You can add add some typing into scripting languages without major issues, but to create types systems on par with C, C++, and Java, changes would have to be made to the language. These changes are best left to language designers. If a type system is desired, it is generally better to switch to a language which was designed with a good type system in mind.

Generally, a type system is only designed when scripting langues are used for larger projects rather than their intended purpose. Microsoft began using Javascript a long time ago for large projects and realized that they would benefit greatly by implementing a type system for Javascript. The result was typescript. piggybacking off of their work, an intern and Roblox was tasked to create roblox-ts, a program which converts typescript into RBXLua. Typescript is widely supported among popular IDEs with tools chains available, which allows Roblox to benefit from all of that work.

Another project to bring type systems into Roblox was my GLR parser, but since a solution has already been found and there are more interesting projects for me to work on (like protected modules) I have put it on the back burner. I to still plan to continue work on it sometime in the future, but the timeline is indeterminate.