NightrainsRbx / RobloxLsp

Roblox Luau Language Server based on Lua by sumneko.
https://devforum.roblox.com/t/roblox-lsp-full-intellisense-for-roblox-and-luau/717745
MIT License
211 stars 49 forks source link

Type packs strict mode #215

Closed GISOjinga closed 1 year ago

GISOjinga commented 1 year ago

I am new to github issue reports bare with me

It appears that when types are packed in regards to methods that it will begin to error within strict mode.

It also appears as if the method doesn't recognize it's self as the first parameter

https://user-images.githubusercontent.com/103523730/224621164-2c7e61ca-56f7-493d-9894-8225fb85734e.mp4

--* type cast for signals
export type Signal<ConnectFunction, ParameterTypes...> = { -- a restructured signaler for auto completion and type casting
    Connect:(Signal<ConnectFunction, ParameterTypes...>, ConnectFunction ) -> (); -- ConnectFunction is a function used for connection purposes
    Wait:(Signal<ConnectFunction, ParameterTypes...>) -> (ParameterTypes...); -- ParameterTypes is a list of types that returns from the wait function
}

--* this is a custom event
export type Event<ConnectFunction, ParameterTypes...> = {
    Fire:(Event<ConnectFunction, ParameterTypes...>, ParameterTypes...)->(), -- to be fired works like a normal event but with type cast
    Event:Signal<ConnectFunction, ParameterTypes...> -- follow the information for the signal type
}

--* The is a type cast for a dog event which should fire information about the gods breed and the amount of legs it has
export type DogEventConnections = Event<(breed:string, legs:number)->(), string, number>

local event:DogEventConnections = Instance.new("RemoteEvent")::any

event:Fire("Doberman", 5)