Skip to content

Commit

Permalink
fixed global namespace being translated to "<global namespace>" inste…
Browse files Browse the repository at this point in the history
…ad of nothing
  • Loading branch information
RobinKa committed May 9, 2019
1 parent 6a30475 commit e40e52b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion NetPrintsEditor/Reflection/ReflectionConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static TypeSpecifier TypeSpecifierFromSymbol(ITypeSymbol type)
}

typeName = nestedPrefix + type.Name.Split('`').First();
if (type.ContainingNamespace != null)
if (type.ContainingNamespace != null && !type.ContainingNamespace.IsGlobalNamespace)
{
typeName = type.ContainingNamespace + "." + typeName;
}
Expand Down
2 changes: 1 addition & 1 deletion NetPrintsEditor/Reflection/ReflectionProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ bool IsSameInterface(INamedTypeSymbol a, INamedTypeSymbol b)
public static string GetFullName(this ITypeSymbol typeSymbol)
{
string fullName = typeSymbol.MetadataName;
if (typeSymbol.ContainingNamespace != null)
if (typeSymbol.ContainingNamespace != null && !typeSymbol.ContainingNamespace.IsGlobalNamespace)
{
fullName = $"{typeSymbol.ContainingNamespace.MetadataName}.{fullName}";
}
Expand Down

0 comments on commit e40e52b

Please sign in to comment.