Refactor type name retrieval to use GetTypeId method#41
Conversation
IvanMurzak
commented
Dec 17, 2025
- Updated TypeReflectionConverter to use GetTypeId instead of GetTypeName for better type identification.
- Modified ExtensionsSerializedMemberList to retrieve parameter type names using GetTypeId.
- Changed ExtensionsType to ensure consistent use of GetTypeId across various methods.
- Refactored MethodData to utilize GetTypeId for return types and parameters.
- Updated MethodRef to use GetTypeShortName for better clarity in type representation.
- Adjusted SerializedMember to initialize typeName with GetTypeId.
- Enhanced MethodWrapper to provide clearer error messages using GetTypeId.
- Refined Reflector.DefaultValue to throw errors with GetTypeId for unsupported types.
- Improved error handling in Reflector.Error to utilize GetTypeId for type mismatch messages.
- Updated Reflector.FindMethod to compare parameter types using GetTypeId.
- Enhanced Reflector.Populate to log type information using GetTypeId.
- Refactored Reflector to throw exceptions with GetTypeId for unsupported serialization/deserialization types.
- Improved JsonSchema to throw exceptions with GetTypeId for schema retrieval failures.
- Enhanced Print utility methods to log type information using GetTypeId.
- Updated StringUtils to throw exceptions with GetTypeId for parameter mismatches.
- Refactored TypeUtils to cache resolved type names and improve type resolution logic.
- Updated TypeReflectionConverter to use GetTypeId instead of GetTypeName for better type identification. - Modified ExtensionsSerializedMemberList to retrieve parameter type names using GetTypeId. - Changed ExtensionsType to ensure consistent use of GetTypeId across various methods. - Refactored MethodData to utilize GetTypeId for return types and parameters. - Updated MethodRef to use GetTypeShortName for better clarity in type representation. - Adjusted SerializedMember to initialize typeName with GetTypeId. - Enhanced MethodWrapper to provide clearer error messages using GetTypeId. - Refined Reflector.DefaultValue to throw errors with GetTypeId for unsupported types. - Improved error handling in Reflector.Error to utilize GetTypeId for type mismatch messages. - Updated Reflector.FindMethod to compare parameter types using GetTypeId. - Enhanced Reflector.Populate to log type information using GetTypeId. - Refactored Reflector to throw exceptions with GetTypeId for unsupported serialization/deserialization types. - Improved JsonSchema to throw exceptions with GetTypeId for schema retrieval failures. - Enhanced Print utility methods to log type information using GetTypeId. - Updated StringUtils to throw exceptions with GetTypeId for parameter mismatches. - Refactored TypeUtils to cache resolved type names and improve type resolution logic.
Test Results 3 files ± 0 3 suites ±0 6m 16s ⏱️ + 2m 49s Results for commit dd0c074. ± Comparison against base commit d1a5aa5. This pull request removes 16 and adds 28 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
This pull request refactors type name retrieval across the codebase to use the GetTypeId() method instead of GetTypeName(pretty: false) for better type identification consistency. The changes introduce significant improvements to type resolution capabilities while also making a breaking change to the array suffix format.
Key Changes
- Enhanced type resolution: Added comprehensive support for resolving C#-style generic types (e.g.,
List<int>), classic generic types, array types, and nested types with thread-safe caching - Breaking API change: Modified
ArraySuffixconstant from"_Array"to"[]"for more natural type representation - Comprehensive updates: Replaced
GetTypeName(pretty: false)withGetTypeId()across 40+ files including converters, error messages, and logging statements - New test coverage: Added extensive test suites (
GetTypeIdTests.csandGetTypeTests.cs) with 500+ lines of test code covering various type scenarios
Reviewed changes
Copilot reviewed 58 out of 58 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| ReflectorNet/src/Utils/TypeUtils.cs | Added thread-safe caching and new type resolution methods for arrays, C#-style generics, and classic generics |
| ReflectorNet/src/Utils/TypeUtils.Name.cs | Updated GetTypeId() to handle nested generic types, changed ArraySuffix constant, improved multi-dimensional array support |
| ReflectorNet/src/Utils/StringUtils.cs | Updated error messages to use GetTypeId() |
| ReflectorNet/src/Utils/Print/Print.cs | Updated logging statements to use GetTypeId() |
| ReflectorNet/src/Utils/Json/JsonSchema.cs | Updated exception messages to use GetTypeId() |
| ReflectorNet/src/Reflector/*.cs | Updated error messages and logging to use GetTypeId() across Reflector core files |
| ReflectorNet/src/Model/*.cs | Updated MethodRef, MethodData, SerializedMember to use GetTypeId() |
| ReflectorNet/src/Extension/*.cs | Updated extension methods to use GetTypeId() |
| ReflectorNet/src/Converter/**/*.cs | Updated all converters to use GetTypeId() in error messages and type comparisons |
| ReflectorNet.Tests/**/*.cs | Updated 10+ test files to use GetTypeId() and added 2 new comprehensive test files |
| ReflectorNet.Tests.OuterAssembly/src/Model/TypeIdTestModels.cs | Added 195 lines of test model classes for comprehensive type testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…tests; add GetTypeShortNameTests for type validation
…pe identification
…zation in GetSchemaTypeId