1
0
Fork 0
godot/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators
Ignacio Roldán Etcheverry f86c6b6ac4 C#: Replace most conversions between Variant and System.Object
This commit replaces most usages of `ConvertManagedObjectToVariant` and
`ConvertVariantToManagedObjectOfType`, by using the `Godot.Variant`
struct instead of `System.Object`.

The most notable change is to the `GetGodotPropertyDefaultValues` method
that's generated for scripts. The dictionary it returns now stores
`Godot.Variant` values.

Remaining usages are:

- The `DelegateUtils` class, for the serialization of closure display
  classes during assembly reloading by the editor. These display classes
  are compiler generated classes to store values captured by a closure.
  Since it's generated by the compiler, the only way we have to access
  the fields is through reflection. This leads to using `System.Object`.
- Converting parameters when invoking constructors from the engine.
  This will be replaced with source generators in the future.
- Legacy support for old `GetGodotPropertyDefaultValues` return values.
  We need to keep supporting the old version of this generated method
  for some time. Otherwise, if loading a project built with the previous
  version, it could lead to the loss of exported property values.
  Ideally, we should remove this legacy support before a stable release.
2022-12-02 14:47:12 +01:00
..
Common.cs C#: Add `global::` namespace to generated source 2022-11-26 01:13:16 +01:00
EventHandlerSuffixSuppressor.cs C#: Suppress EventHandler suffix diagnostic for signals 2022-09-22 14:23:01 +02:00
ExtensionMethods.cs C#: Add `global::` namespace to generated source 2022-11-26 01:13:16 +01:00
Godot.SourceGenerators.csproj C#: Make GodotSharp API a NuGet package 2022-08-22 03:36:51 +02:00
Godot.SourceGenerators.props C#/netcore: Add base desktop game export implementation 2022-08-22 03:36:51 +02:00
GodotClasses.cs Add MustBeVariant attribute and analyzer 2022-08-25 01:47:40 +02:00
GodotEnums.cs C#: Synchronize Godot enums with core 2022-11-19 01:54:23 +01:00
GodotMemberData.cs Add `readonly` to C# methods and types that don't mutate 2022-11-14 20:32:20 +01:00
GodotPluginsInitializerGenerator.cs Use `.generated` suffix for generated C# code 2022-10-22 23:13:52 +02:00
MarshalType.cs C#: Re-introduce generic Godot Array and Dictionary 2022-08-22 03:36:52 +02:00
MarshalUtils.cs C#: Replace most conversions between Variant and System.Object 2022-12-02 14:47:12 +01:00
MethodInfo.cs Add `readonly` to C# methods and types that don't mutate 2022-11-14 20:32:20 +01:00
MustBeVariantAnalyzer.cs C#: Make MustBeVariantAnalyzer ignore OmittedTypeArgument 2022-09-06 18:51:45 +02:00
PropertyInfo.cs Add `readonly` to C# methods and types that don't mutate 2022-11-14 20:32:20 +01:00
ScriptMethodsGenerator.cs C#: Add `global::` namespace to generated source 2022-11-26 01:13:16 +01:00
ScriptPathAttributeGenerator.cs C#: Add `global::` namespace to generated source 2022-11-26 01:13:16 +01:00
ScriptPropertiesGenerator.cs Merge pull request #65907 from magian1127/4.0FixPropertiesGenerator 2022-11-28 01:48:52 +01:00
ScriptPropertyDefValGenerator.cs C#: Replace most conversions between Variant and System.Object 2022-12-02 14:47:12 +01:00
ScriptRegistrarGenerator.cs
ScriptSerializationGenerator.cs C#: Add `global::` namespace to generated source 2022-11-26 01:13:16 +01:00
ScriptSignalsGenerator.cs C#: Add `global::` namespace to generated source 2022-11-26 01:13:16 +01:00