vscode-mtalua
vscode-mtalua copied to clipboard
Add OOP Methods
Object Orientated Programming was introduced in MTA:SA 1.4
For this to work I would need to write a full blown code parser. This means parsing files and determining their types ex:
local position = Vector3(300, -200, 2)
local vehicle = Vehicle(411, position)
vehicle.position = centreOfMap - Vector3(300, -200, 0)
The variable vehicle has to be parsed and set as "Vehicle" type internally. Then when the code completion handler is triggered (By typing "vehicle.") the parser has to lookup the type of vehicle, take the type and list all possible "methods" and "fields".