Tutorial - include-marcy/luau-class-generator GitHub Wiki
Visual Studio Code is sometimes a confusing and perplexing piece of software, so I am writing this tutorial for you so that there is minimal confusion surrounding the tool luau-class-generator.
- Ensure you have installed Visual Studio Code.
- Ensure you have installed and are familiar with Rojo and Roblox Studio. Link a Rojo
project.json
to a Roblox Studio.rbxl
. - Install this extension using the Visual Studio Code Marketplace
- Inside your repository, create a file for the type outputs, with either the
.lua
or.luau
file extension types. - Right click the file, and select the option
LCG: Set Types File
(see fig. A) to configure this file as the "Library Types" module.
Figure A.
- Visit the configurations page (fig. B) to change the output of the luau-class-generator to your liking.
Figure B.
- Here you can configure:
- The license name to administer in each file at the top
- Luau Dynamic Fast Flags and Luau Fast Flags
- Library Name
- Library Prefix
- Comment Detail Levels
- Right click any
.luau
or.lua
file and select the methodLCG: New Class
to create a new Luau class with fully initialized boiler plate.
NOTE: Right click any folder and select LCG: New File + Class
to be prompted to enter a class name and description and the extension will also create a new file and class automatically for you.
- You may be prompted to rename the file to include the
Library Prefix
at the beginning of the name of your class. It is up to you whether you wish to include this. - You will be prompted to include a general description of the class at its creation.
- Right click any file which has generated a class and select
LCG: New Method
to add a new method. You will be prompted to give your method a name and general description. It will generate boiler plate and comment descriptions (see fig. C) for you.
Figure C.