Code Templates - Easily Apply Templates to Your Scripts

This is awesome! Will there ever be support for undoing/redoing?

1 Like

If I remember right, ChangeHistoryService does not work with scripts. Iā€™ll check it again later sometime though. Just been busy recently.

2 Likes

Great plugin! Extremely helpful as I make object oriented classes and subclasses, and a must have when adding Roact classes. Great all around! One request however. Unfortunately, I prefer to use light mode (yes, dark mode is better, etc, etc). Would you be willing to add light mode functionality for us light mode users? Currently it strains my eyes to read light grey text on white background when adding in new templates. Also, the icons are only in white and hard to see in light mode. If you do consider adding in these changes, thank you very much!

2 Likes

Okay, I really thought this would fix one of my biggest problems, but itā€™s still confusing to load templates into scripts in my opinion.

2 Likes

Thanks for the feedback! I changed input fields so that the color updates when changing themes. This is in the latest update. Unfortunately, the icons are gonna be harder to fix and Iā€™ve been busy recently. This shouldnā€™t be an issue as the text is fine. Iā€™ll fix this with v2 though. If you experience any other issues please let me know!

1 Like

Hey, Would you like some help, Iā€™m willing to make you UI for the plugin for free cause its really helpful plugin and Iā€™m kinda bored so DM on the forums and Iā€™ll provide you with some examples tho I might take some time to respond since I donā€™t visit forums as much

Unfortunately, this plugin is wiping & replacing my script contents when I switch between two scripts. (Read bug report for more info)

I have the latest version of Code Templates Lite.

Hi there. Iā€™ll look into this issue immediately! Thank you for letting me know.

1 Like

I looked into this issue and I think I found a very small edge case that frequently occurred due to how the plugin works. I think I have resolved this issue in the latest update, but itā€™s hard to test to be sure. If you have any more issues with it please let me know!

Yup, it seems the update fixed it. Thanks!

1 Like

Hi again. Just wanted to check and make sure that this bug has been resolved. I know itā€™s a pretty hard to reproduce bug and I actually had a bit of trouble reproducing it when originally reported. Has the plugin been stable since the update a couple days ago?

Yeah, I havenā€™t been able to reproduce it anymore.

1 Like

Very nice plugin. Is there a ā€œProā€ version coming? I definitely buy it.

Is there to stop the script from jumping to the Top of the page after pasting? If used at the bottom of a very long script, you have to scroll to find where you were.

Iā€™d like to be able to click the Keyword from the list and have it copy to clipboard or paste directly

I was bit annoyed about this too so decided to edit the pluginā€™s source lol
hereā€™s my version


I fixed that issue by utilizing the OpenScript method, which has a line number parameter and I used that parameter to the open the script to the line where the template was applied.

Another thing I added was the ability to apply templates with custom names
eg. --$lua class @NameOfClassHere
will apply the template but replace _name with NameOfClassHere
as such:


as for

Iā€™d like to be able to click the Keyword from the list and have it copy to clipboard or paste directly

we cant actually copy anything to a userā€™s clipboard

If @brooklynskies could implement these into the original plugin then it will be really great!

Hereā€™s my edited version of the plugin (this wont be updated its just for OP for looking through the code)
CodeTemplatesEdited.rbxm (44.5 KB)

3 Likes

Very cool! Reminds me of snippets in Visual Studio Code

I didnā€™t know how to edit a pluginā€™s script before this. Thanks!

Great plugin mate, keep it coming!
Here is my default class template:

local $NAME$ = {ClassName = "$NAME$"}
$NAME$.__index = $NAME$

-- Constructor
function $NAME$.new()
	local self = {
		
	}
	
	return setmetatable(self, $NAME$)
end

-- Destructor
function $NAME$:Destroy()
	table.clear(self)
end

return $NAME$
1 Like