TypeAhead is a plugin that gives you the power to create your own autocomplete suggestions. You define your own words and phrases, and TypeAhead will suggest them as you type.
Why TypeAhead?
Roblox Studio’s default autocomplete is great at its job, but it doesn’t allow you to define your own custom suggestions, unlike TypeAhead, which lets you do just that.
TypeAhead can handle up to 1000 custom autocomplete suggestions without any noticeable lag.
TypeAhead will help you reduce repetitive typing, thereby lowering the chances of typos.
How to use it?
1. Install it
TypeAhead is a blank canvas, where you can create your own autocompletes, with one example included to help you understand how autocomplete suggestions work in the plugin.
2. Create your first suggestion
To create your first suggestion, click the Create button:
After pressing this button, a menu will pop up where you can define the custom logic for your suggestion.
Some of the fields may not be self-explanatory, so I recommend checking out this example:
Where:
Name - The display name of the autocomplete suggestion in the content frame.
Triggers - The words that will make the autocomplete suggestion pop up.
Patterns - Checks for current patterns in the script. If found, the suggestion won’t be shown. ANY_TRIGGER gets replaced by the trigger that made the suggestion pop up.
Replacement - This will replace the trigger with the specified string when you choose the autocomplete suggestion. The first %s in the string will be replaced by the trigger that made the suggestion pop up.
Detail - Functions like a description for your autocomplete suggestion when it appears.
Icon - The icon next to the autocomplete suggestion.
Context - The suggestion will only appear if it’s in the correct context. LocalFunction context:
More about contexts
Global – The autocomplete suggestion will appear in all contexts.
OnlyGlobal – The suggestion will appear only in the global (main) context.
AnyFunction – The suggestion will appear only inside functions, whether global or local.
GlobalFunction – The suggestion will appear only inside global functions.
LocalFunction – The suggestion will appear only inside local functions.
CaseSensitive - The suggestion will only show if the trigger matches the exact case. For example, experiment won’t show the autocomplete suggestion, but Experiment will.
PreserveCase - This will preserve the case for the trigger that made the suggestion pop up. This will change how ANY_TRIGGER and the first %s in the Pattern and Replacement work.
Issue report
Feel free to report any issues directly in this topic!
Credits
Libraries
StudioWidgets - Was used to create the plugin widget GUI.
Nice to see that there’s been an influx of ScriptEditorService plugins now. I used to have one way before ScriptEditorService was introduced.
Couldn’t you just call it “description” then?
Why the ?
Yeah, this really needs to be improved. Not just UI, but the UX just feels horrible just from thinking about the workflow. I recommend you use another UI library, such as:
Coincidentally, your plugin inspired me to create this plugin, so thanks for the idea! (btw you’ve made a blank hyperlink)
Oops, the period was meant to be there
Detail is the term used in the ScriptEditorService, so I didn’t bother changing it, but I can change it for readability tho
Thanks for the resources! I was unable to find any libraries at the time besides StudioWidgets (I mainly chose it so I wouldn’t have to create a Studio like UI from scratch.)
This plugin is a personal project created to gain some experience in plugin making. I’ve decided to share my work with others simply for the sake of it
, maintaining a resource is quite hard when you’ve got stuff cramping in, so I would say commit to a resource instead of doing multiple resources (blatant mistake I did)
oh I accidentally made a double parentheses
Yeah, keeping it consistent could avoid mishaps in your code. But you should view your code into 2 sections, the logic section, and the UI section. The logic is where you use detail as the term, but in the UI you should use the more understood term, description.
I just looked at SimpleComplete and can say that my plugin’s purpose is a bit different from SimpleComplete’s (as far as I understood from the SimpleComplete post; if I’m wrong, feel free to correct me)
My plugin lets you create your own autocomplete suggestions, and that’s the only functionality it currently offers. You can use it to make fully custom autocomplete suggestions (e.g., you can create an autocomplete suggestion for return "Hello World" inside of functions), whereas SimpleComplete handles all the good stuff for you (again, as far as I understand from the SimpleComplete post)
Currently the closest thing to how TypeAhead works is snippets which allows you to define a module which returns a table of snippets which will be autocompleted, I agree the way both plugin works is very different and theres no value in comparing the two :V