Skip to content

Support rename for #[var] #1262

@ttencate

Description

@ttencate

It exists for #[func] and #[class], so this just seems like an oversight.

It's especially useful in combination with the new PhantomVar (#1261) since you could have a Rusty-typed field exposed to Rust and a Godoty-typed field exposed to Godot with the same name, e.g.

    name: String,

    #[var(rename = "name", get = get_name, set = set_name)]
    _name: PhantomVar<GString>,

As a user, I'd expect this to rename (the Godot side of) autogenerated getters and setters as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: registerRegister classes, functions and other symbols to GDScriptfeatureAdds functionality to the librarygood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions