C#: Use SymbolEqualityComparer

Use `SymbolEqualityComparer` to compare symbols and fix `RS1024` warning.
This commit is contained in:
Raul Santos 2023-08-05 19:45:22 +02:00
parent 907db8eebc
commit 7b348708e8
No known key found for this signature in database
GPG key ID: B532473AE3A803E4

View file

@ -55,8 +55,8 @@ namespace Godot.SourceGenerators
.Where(x =>
// Ignore classes whose name is not the same as the file name
Path.GetFileNameWithoutExtension(x.cds.SyntaxTree.FilePath) == x.symbol.Name)
.GroupBy(x => x.symbol)
.ToDictionary(g => g.Key, g => g.Select(x => x.cds));
.GroupBy<(ClassDeclarationSyntax cds, INamedTypeSymbol symbol), INamedTypeSymbol>(x => x.symbol, SymbolEqualityComparer.Default)
.ToDictionary<IGrouping<INamedTypeSymbol, (ClassDeclarationSyntax cds, INamedTypeSymbol symbol)>, INamedTypeSymbol, IEnumerable<ClassDeclarationSyntax>>(g => g.Key, g => g.Select(x => x.cds), SymbolEqualityComparer.Default);
foreach (var godotClass in godotClasses)
{