Skip to content

Commit

Permalink
Merge pull request godotengine#67766 from raulsntos/dotnet-generated
Browse files Browse the repository at this point in the history
Use `.generated` suffix for generated C# code
  • Loading branch information
neikeq authored Oct 23, 2022
2 parents 0b627c4 + 687633e commit 4546986
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static godot_bool InitializeFromGameProject(IntPtr godotDllHandle, IntPt
}
";

context.AddSource("GodotPlugins.Game_Generated",
context.AddSource("GodotPlugins.Game.generated",
SourceText.From(source, Encoding.UTF8));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ INamedTypeSymbol symbol
bool isInnerClass = symbol.ContainingType != null;

string uniqueHint = symbol.FullQualifiedName().SanitizeQualifiedNameForUniqueHint()
+ "_ScriptMethods_Generated";
+ "_ScriptMethods.generated";

var source = new StringBuilder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ IEnumerable<ClassDeclarationSyntax> classDeclarations
string.Empty;
bool hasNamespace = classNs.Length != 0;

var uniqueHint = symbol.FullQualifiedName().SanitizeQualifiedNameForUniqueHint()
+ "_ScriptPath_Generated";
string uniqueHint = symbol.FullQualifiedName().SanitizeQualifiedNameForUniqueHint()
+ "_ScriptPath.generated";

var source = new StringBuilder();

Expand Down Expand Up @@ -126,7 +126,7 @@ IEnumerable<ClassDeclarationSyntax> classDeclarations
source.Append("\n}\n");
}

context.AddSource(uniqueHint.ToString(), SourceText.From(source.ToString(), Encoding.UTF8));
context.AddSource(uniqueHint, SourceText.From(source.ToString(), Encoding.UTF8));
}

private static void AddScriptTypesAssemblyAttr(GeneratorExecutionContext context,
Expand Down Expand Up @@ -157,7 +157,7 @@ private static void AddScriptTypesAssemblyAttr(GeneratorExecutionContext context

sourceBuilder.Append("})]\n");

context.AddSource("AssemblyScriptTypes_Generated",
context.AddSource("AssemblyScriptTypes.generated",
SourceText.From(sourceBuilder.ToString(), Encoding.UTF8));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ INamedTypeSymbol symbol
bool isInnerClass = symbol.ContainingType != null;

string uniqueHint = symbol.FullQualifiedName().SanitizeQualifiedNameForUniqueHint()
+ "_ScriptProperties_Generated";
+ "_ScriptProperties.generated";

var source = new StringBuilder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ INamedTypeSymbol symbol
bool isInnerClass = symbol.ContainingType != null;

string uniqueHint = symbol.FullQualifiedName().SanitizeQualifiedNameForUniqueHint()
+ "_ScriptPropertyDefVal_Generated";
+ "_ScriptPropertyDefVal.generated";

var source = new StringBuilder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ INamedTypeSymbol symbol
bool isInnerClass = symbol.ContainingType != null;

string uniqueHint = symbol.FullQualifiedName().SanitizeQualifiedNameForUniqueHint()
+ "_ScriptSerialization_Generated";
+ "_ScriptSerialization.generated";

var source = new StringBuilder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ INamedTypeSymbol symbol
bool isInnerClass = symbol.ContainingType != null;

string uniqueHint = symbol.FullQualifiedName().SanitizeQualifiedNameForUniqueHint()
+ "_ScriptSignals_Generated";
+ "_ScriptSignals.generated";

var source = new StringBuilder();

Expand Down

0 comments on commit 4546986

Please sign in to comment.