Skip to content

Class generated by the Autoload attribute has different namespace #162

@ErnSur

Description

@ErnSur

Hello!
I discovered where Autoload attribute is used the source generator creates a class with the same name but in different namespace.
The documentation is explicit about it but I don't get why that would be the intended behavior.

Given:

namespace Foo;

[Autoload]
public static partial class Bar;

The following code is generated:

using System;
using System.ComponentModel;

namespace Godot;

static partial class Bar
{
    private static Node root = (Engine.GetMainLoop() as SceneTree)?.Root;
}

Expected:

using System;
using System.ComponentModel;

namespace Foo;

static partial class Bar
{
    private static Node root = (Engine.GetMainLoop() as SceneTree)?.Root;
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions