New Type Solver not providing autocompletes for arguments within functions within tables

This is a bug report after this discussion here.

With the following code and using the new type solver:

type Arg = "Hi" | "Player" | "Okay" | "Test"
type Task = typeof({
	buff = function(self: Task)

	end,
	start = function(self: Task)

	end,
	destroy = function(self: Task)

	end,
})
type Command = {
	name: string,
	aliases: {string}?,
	args: {Arg},
	prefixes: {string}?,
	autoPreview: boolean?,
	revokeRepeats: boolean?,
	cooldown: number?,
	run: (task: Task) -> ()
}


-- COMMANDS
local commands: {Command} = {
	
    --------------------
    {
		name = "dance",
		aliases = {"dce"},
		args = {"Player", "Okay"},
		prefixes = {"/", "@"},
		cooldown = 123,
		run = function(task)
			
		end,
	},


    --------------------
	{
		name = "fly",
		aliases = {"ccc2"},
		args = {"Player", "Test"},
	},

    --------------------
}


-- RETURN
return commands

It’s currently impossible to have the parameter ‘task’ within the function ‘run’ auto complete without defining the Task type for every command, whereas this is possible in the old solver.

For example:

  1. Current setup, less desirable, but working:

    run = function(task: Task)
    	
    end,
    

  2. Desired setup, but not working:

    run = function(task)
    	
    end,
    

All the other auto competes work as expected (args, cooldown, name, etc).

It’s not necessary, but being able to do (2) would greatly help organise and reduce duplicate code with the new type solver.

Hello! Thank you for the bug report, and for beta testing the new type solver! We’re aware of this issue. It might take a bit to address as we’re more focused on performance / stability at the moment, but we’ll try to keep you in the loop as we fix this.

1 Like

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