mirror of
https://github.com/godotengine/godot.git
synced 2025-10-31 21:51:22 +00:00
C#: Add global:: namespace to generated source
Adds `global::` to the fully qualified types in source generators to prevent ambiguity.
This commit is contained in:
parent
5923df9234
commit
b9e1ca1e86
12 changed files with 108 additions and 91 deletions
|
|
@ -66,13 +66,13 @@ namespace Godot.SourceGenerators
|
|||
{
|
||||
INamespaceSymbol namespaceSymbol = symbol.ContainingNamespace;
|
||||
string classNs = namespaceSymbol != null && !namespaceSymbol.IsGlobalNamespace ?
|
||||
namespaceSymbol.FullQualifiedName() :
|
||||
namespaceSymbol.FullQualifiedNameOmitGlobal() :
|
||||
string.Empty;
|
||||
bool hasNamespace = classNs.Length != 0;
|
||||
|
||||
bool isInnerClass = symbol.ContainingType != null;
|
||||
|
||||
string uniqueHint = symbol.FullQualifiedName().SanitizeQualifiedNameForUniqueHint()
|
||||
string uniqueHint = symbol.FullQualifiedNameOmitGlobal().SanitizeQualifiedNameForUniqueHint()
|
||||
+ "_ScriptPropertyDefVal.generated";
|
||||
|
||||
var source = new StringBuilder();
|
||||
|
|
@ -249,7 +249,7 @@ namespace Godot.SourceGenerators
|
|||
string defaultValueLocalName = string.Concat("__", exportedMember.Name, "_default_value");
|
||||
|
||||
source.Append(" ");
|
||||
source.Append(exportedMember.TypeSymbol.FullQualifiedName());
|
||||
source.Append(exportedMember.TypeSymbol.FullQualifiedNameIncludeGlobal());
|
||||
source.Append(" ");
|
||||
source.Append(defaultValueLocalName);
|
||||
source.Append(" = ");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue