Skip to content

Replace all godot:: with ::godot:: - #2025

Merged
dsnopek merged 1 commit into
godotengine:masterfrom
dsnopek:prefix-godot-namespace
Jul 26, 2026
Merged

Replace all godot:: with ::godot::#2025
dsnopek merged 1 commit into
godotengine:masterfrom
dsnopek:prefix-godot-namespace

Conversation

@dsnopek

@dsnopek dsnopek commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

In most places, we're already using ::godot:: but a few were missing it and a few were added in a recent sync's (#2014)

This PR attempts to replace all godot:: with ::godot::

@dsnopek dsnopek added this to the 10.x milestone Jul 25, 2026
@dsnopek
dsnopek requested a review from a team as a code owner July 25, 2026 11:00
@dsnopek dsnopek added bug This has been identified as a bug enhancement This is an enhancement on the current functionality labels Jul 25, 2026
@dsnopek
dsnopek force-pushed the prefix-godot-namespace branch from 3c9aa18 to 61dbeaa Compare July 25, 2026 11:15

@YakoYakoYokuYoku YakoYakoYokuYoku left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Some nits regarding example code, the rest LGTM.

Comment thread test/src/register_types.cpp
Comment thread README.md Outdated
@dsnopek
dsnopek force-pushed the prefix-godot-namespace branch from 61dbeaa to 32dc551 Compare July 26, 2026 11:49

@Ivorforce Ivorforce left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The leading :: should only be needed if used inside macros.

While technically more precise, it's usually not done, probably to keep it looking cleaner?

In macros it makes a lot of sense though because the source namespace isn't known (only established after macro expansion) which is what caused https://github.com/Zylann/godot_voxel/actions/runs/30151875176/job/89663504724.

If you'd prefer to always use a leading :: I'll go along with it, but I personally would prefer to default to omit it.

\
static void *_gde_binding_create_callback(void *p_token, void *p_instance) { \
/* Do not call memnew here, we don't want the post-initializer to be called */ \
return new (godot::DefaultAllocator{}) m_class((GodotObject *)p_instance); \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As an example, this one is needed...

static GDExtensionInitializationLevel current_level;

friend class godot::GDExtensionBinding;
friend class ::godot::GDExtensionBinding;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

... while this one isn't.

@dsnopek

dsnopek commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

If you'd prefer to always use a leading :: I'll go along with it, but I personally would prefer to default to omit it.

Yeah, personally, I'd prefer to always use the leading :: everywhere within godot-cpp itself, because it's simplest to standardize on a single convention

@Ivorforce Ivorforce left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, fine by me!

Code looks good to me; thanks for the fix!

@dsnopek
dsnopek merged commit 357ad86 into godotengine:master Jul 26, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This has been identified as a bug enhancement This is an enhancement on the current functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants