Is there a way I can change this to my own preference? As far as I know, the Roblox style guide suggests the following:
Use camelCase names for local variables, member values, and functions.
This happens commonly in class creation. It’s easily solvable with hungarian notation (which is not that recommended), or naming it according to the context, but I personally want these variables should have preference in the current scope.
local Vehicle = {}
function Vehicle.new() end
local vehicle = Vehicle.new()
-- have to write all of vehicle. doing vehic would complete it to Vehicle, making it
-- even more error prone because youre not calling the actual object.
vehicle:start()
You can try it yourself by defining two variables.
local Variable = 1
local variable = 2
-- Typing 'variabl'
-- Variable is suggested
Variable
-- Now, typing 'variable' entirely
-- variable is finally suggested
variable
Yeah, it’s not a big problem, but it gets kinda confusing when calling multiple methods on a class. The biggest issue is accidentally calling the class instead of the object.
It likely follows the declaration order in autocomplete.
Also the style guide is just a recommendation, use whatever writing style you want.
Regarding the topic:
-- you can underscore a variable if names collide,
-- it will help distinguishing them greatly
local Vehicle
local _Vehicle
--- or just to reduce your confusion do not name them the same
local VehicleModule = require(module)
local Car = VehicleModule.new()
Currently i don’t think u can do much about it except the underscore method tbh roblox should indeed make the type suggestions based what u write, so if u write capital the capital one comes if not the opposite