Code Templates - Easily Apply Templates to Your Scripts

I’ve been working on an update for this plugin to add lots of new features, but it’s currently blocked by some things outside my control.

1 Like

Oh dang! Well hopefully these said restrictions are eased, thanks for responding either way!

1 Like

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

Hi there, for some reason it doesn’t work for me?

image


I tried the automatic tag method and the regular one, but both didn’t work.
Script injection is allowed and the plugin is up to date.