You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Fix source generator exceptions appearing when use "@+internal keyword" as type or namespace name in C# script
This commit is contained in:
@@ -181,13 +181,6 @@ namespace Godot.SourceGenerators
|
||||
};
|
||||
}
|
||||
|
||||
public static string NameWithTypeParameters(this INamedTypeSymbol symbol)
|
||||
{
|
||||
return symbol.IsGenericType && symbol.TypeParameters.Length > 0 ?
|
||||
string.Concat(symbol.Name, "<", string.Join(", ", symbol.TypeParameters), ">") :
|
||||
symbol.Name;
|
||||
}
|
||||
|
||||
private static SymbolDisplayFormat FullyQualifiedFormatOmitGlobal { get; } =
|
||||
SymbolDisplayFormat.FullyQualifiedFormat
|
||||
.WithGlobalNamespaceStyle(SymbolDisplayGlobalNamespaceStyle.Omitted);
|
||||
@@ -268,6 +261,8 @@ namespace Godot.SourceGenerators
|
||||
|
||||
public static string SanitizeQualifiedNameForUniqueHint(this string qualifiedName)
|
||||
=> qualifiedName
|
||||
// AddSource() doesn't support @ prefix
|
||||
.Replace("@", "")
|
||||
// AddSource() doesn't support angle brackets
|
||||
.Replace("<", "(Of ")
|
||||
.Replace(">", ")");
|
||||
|
||||
Reference in New Issue
Block a user