Skip to content

Conversation

@lilizoey
Copy link
Member

Also fix a broken link in the docs for the GodotClass derive macro to PhantomVar.

fixes #1262

@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1388

Copy link
Member

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

Comment on lines 163 to 168
assert!(prop_list
.iter_shared()
.any(|d| d.get("name") == Some("renamed_variable".to_variant())));
assert!(prop_list
.iter_shared()
.any(|d| d.get("name") == Some("renamed_variable".to_variant())));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidental duplicate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh whoops yeah i meant to check that it doesn't contain the unused name

Comment on lines 182 to 193
#[itest]
fn test_renamed_var_getter_setter() {
let obj = HasProperty::new_alloc();

assert!(obj.has_method("get_renamed_variable"));
assert!(obj.has_method("set_renamed_variable"));
assert!(!obj.has_method("get_unused_name"));
assert!(!obj.has_method("get_unused_name"));

obj.free();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the generated getters in Rust (accessible at compile time) also renamed, or do they use the original field name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh good question, i should test that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is renamed as well, but it should probably not be right? so that all the rust-accessible stuff uses the rust name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's OK to rename -- we should maybe discuss whether the auto-generated Rust getter/setters still make sense in general, in #1263 or so 🤔

@Bromeon Bromeon added feature Adds functionality to the library c: register Register classes, functions and other symbols to GDScript labels Oct 28, 2025
Copy link
Member

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Bromeon Bromeon added this pull request to the merge queue Oct 29, 2025
Merged via the queue into godot-rust:master with commit 69c346e Oct 29, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: register Register classes, functions and other symbols to GDScript feature Adds functionality to the library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support rename for #[var]

3 participants