Skip to content

Commit 53614e7

Browse files
committed
Add comments to GetFullMetadataNameForFileName
1 parent f8dcd09 commit 53614e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CommunityToolkit.Mvvm.SourceGenerators/Extensions/INamedTypeSymbolExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ static StringBuilder BuildFrom(ISymbol? symbol, StringBuilder builder)
3333
};
3434
}
3535

36+
// Build the full metadata name by concatenating the metadata names of all symbols from the input
37+
// one to the outermost namespace, if any. Additionally, the ` and + symbols need to be replaced
38+
// to avoid errors when generating code. This is a known issue with source generators not accepting
39+
// those characters at the moment, see: https://github.com/dotnet/roslyn/issues/58476.
3640
return BuildFrom(symbol, new StringBuilder(256)).ToString().Replace('`', '-').Replace('+', '.');
3741
}
3842

0 commit comments

Comments
 (0)