Autocomplete suggestions from dictionary for a parameter

(Sorry, can’t think of a better title)

Hello everyone, I was implementing a new function to one of my gui handling module, and I needed to add hiding/showing function, which I wanted to make into one function.
I have dictionary with string keys, which point to gui instances, and I was wondering how or is it even possible to do something like this:

local PointerDict = {
    ["Screen1"] = PlayerGui.Screen1,
    ["Screen2"] = playerGui.Screen2,
    ...
}

function ShowGui(Visible: boolean, GuiType)
    ...
end

I’d want the autocomplete suggest keys from the dictionary, is this possible in the studio, or in some external IDE/editor?

Found solution myself instead,
Forgot that Roblox has new type solver, which introduced quite a lot of useful features, all explained in this neat guide: Luau’s New Type Solver: How to utilize type functions!

Using (funnily enough, it’s actually the first function explained in the guide) keyof function in following format: type NewType = keyof<typeof(PointerDict)> does exactly what I needed to.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.