Custom Highlighting

As a developer is hard (not that hard tho but you will understand the point through out this post) for me to organize my code. I want to have a tool to add a custom highlighting (Color) to a word. Let’s say I want to create special functions like the one made in C++ switch, let’s also say the function is completely ready for use and I use many times through out the code. Now here is the thing, I know is not that hard to find the words but I would like to give it a color to them, like blue, green, red, yellow, etc. I don’t want to assign custom functions to words, I just want to add a color to them, cuz the code looks dead with just red, white, and blue.

It doesn’t matters if I go to another script and the word is highlighted as well. I just care about having them highlighted. In short I just want a way to highlight a piece of a text because is hard to find or to see some important functions or variables. I will appreciate it a lot, if you guys don’t feel good or don’t like the idea with this it’s ok, but a lot of thanks if you make it. :relaxed:

AN IDEA IS SHOWN BELOW:

1- Select the piece of string.
2- Right click on it.
3- Highlight Button.
4- Chose a color
5- After choosing the color and clicking accept, all the scripts with that word will get the specific word highlighted in it when accessing. (meaning if I do it to a word for example switch and I choose green. All switch words in every script will get highlighted. :smiley: ).

Thank you, focasds.

14 Likes

Bumping this, but with my own description and example of a use-case:

I’m very reliant on Object-Oriented Programming. It’s a very powerful way to program. In Lua it’s obviously a little weird, but I use it regardless.

In my classes, I tend to name the object being created by the constructor “self”. Because self is an existing keyword, however, this causes major issues with the type checker. The “self” variable is also overwritten in every function, so it makes writing methods 3x harder. I’ve found workarounds that are quite nice and allow me to continue using “self” for the sake of highlighting and code readability, but it’s not great for the long term.

If I had the ability to define custom keywords/highlights in the script editor settings, I’d be able to give myself a new key word to use in all of my scripts. I’d add “this” as a keyword with identical highlighting to the “self” keyword, and then name all of my objects this.

I could also use this feature to create keywords/highlights for “Class”, “Module”, “Data”, and many other common variable names I use throughout a vast multitude of different scripts.

This would be a huge boost for making scripts more readable. It’d be similar to any other IDE’s theme extensions, putting the Roblox scripting IDE that much closer to being a preferable development environment to other IDEs.