@@ -16,14 +16,6 @@ namespace MongoDB.Analyzer.Core;
1616
1717internal sealed class TypesProcessor
1818{
19- private static readonly Dictionary < string , string > s_knownTypes = new ( )
20- {
21- { "MongoDB.Bson.BsonDocument" , "BsonDocumentCustom123" } ,
22- { "MongoDB.Bson.BsonValue" , "BsonValueCustom123" } ,
23- { "MongoDB.Bson.BsonObjectId" , "BsonObjectIdCustom123" } ,
24- { "MongoDB.Bson.BsonType" , "BsonTypeCustom123" }
25- } ;
26-
2719 private readonly Dictionary < string , ( string NewName , MemberDeclarationSyntax NewDeclaration ) > _processedTypes ;
2820
2921 private int _nextTypeId = 0 ;
@@ -43,9 +35,9 @@ public string GetTypeSymbolToGeneratedTypeMapping(ITypeSymbol typeSymbol)
4335 }
4436
4537 var fullTypeName = GetFullName ( typeSymbol ) ;
46- if ( s_knownTypes . TryGetValue ( fullTypeName , out var knowTypeName ) )
38+ if ( typeSymbol . IsSupportedBsonType ( ) )
4739 {
48- return knowTypeName ;
40+ return typeSymbol . Name ;
4941 }
5042
5143 if ( _processedTypes . TryGetValue ( fullTypeName , out var result ) )
@@ -64,9 +56,9 @@ public string ProcessTypeSymbol(ITypeSymbol typeSymbol)
6456 }
6557
6658 var fullTypeName = GetFullName ( typeSymbol ) ;
67- if ( s_knownTypes . TryGetValue ( fullTypeName , out var knowTypeName ) )
59+ if ( typeSymbol . IsSupportedBsonType ( ) )
6860 {
69- return knowTypeName ;
61+ return typeSymbol . Name ;
7062 }
7163
7264 if ( _processedTypes . TryGetValue ( fullTypeName , out var pair ) )
0 commit comments