Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of generic C# types #87890

Merged
merged 1 commit into from
Feb 12, 2024

Commits on Feb 8, 2024

  1. Improve handling of generic C# types

    - Create CSharpScript for generic C# types.
      - `ScriptPathAttributeGenerator` registers the path for the generic type definition.
      - `ScriptManagerBridge` lookup uses the generic type definition that was registered by the generator.
      - Constructed generic types use a virtual `csharp://` path so they can be registered in the map and loaded as if there was a different file for each constructed type, even though they all share the same real path.
      - This allows getting the base type for a C# type that derives from a generic type.
    - Shows base scripts in the _Add Node_ and _Create Resource_ dialogs even when they are generic types.
      - `get_global_class_name` implementation was moved to C# and now always returns the base type even if the script is not a global class (this behavior matches GDScript).
    - Create `CSharpScript::TypeInfo` struct to hold all the type information about the C# type that corresponds to the `CSharpScript`, and use it as the parameter in `UpdateScriptClassInfo` to avoid adding more parameters.
    raulsntos committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    5815d1c View commit details
    Browse the repository at this point in the history