Skip to content

Make rename_variables detect globals automatically #336

@benomat

Description

@benomat

Currently it tries to avoid using globals as variable names with a predefined list (default and roblox). This method is fundamentally flawed.

A solution a lot more simple and robust than making a list for every possible environment is avoiding all globals used in the file for local names

example:

local somevariable="wowww";
print(game,workspace,a,somevariable)

for this example the avoided names would be "game", "workspace", "a"

Why is this needed? The example shown above would output code that functions differently when using the rename_variables option:

local a="wowww";
print(game,workspace,a,a)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions