-
Notifications
You must be signed in to change notification settings - Fork 120
Update AsmResolver and use auto-import in 'cswinrtgen' #2140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging/3.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the AsmResolver library and leverages its new auto-import functionality to significantly simplify code throughout the cswinrtgen project. The changes remove manual calls to .Import(module) across numerous files, as the updated AsmResolver version now handles imports automatically.
Key Changes:
- Updated AsmResolver.DotNet from version 6.0.0-development.282 to 6.0.0-development.317
- Removed all manual
.Import(module)calls throughout the codebase - Eliminated the
moduleparameter from several method signatures where it's no longer needed - Deleted the entire
ImportExtensions.csfile which provided manual import helper methods
Reviewed changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Packages.props | Updated AsmResolver.DotNet package version |
| InteropGenerator.Emit.cs | Removed module parameter from multiple method calls |
| InteropGenerator.Discover.cs | Removed .Import(module) calls for assembly references |
| WellKnownTypeDefinitionFactory.cs | Removed .Import(module) calls throughout type and field definitions |
| WellKnownTypeDefinitionFactory.IgnoreAccessChecksToAttribute.cs | Removed .Import(module) calls in attribute creation |
| WellKnownMemberDefinitionFactory.cs | Removed module parameter from method signatures and .Import(module) calls |
| WellKnownCilMethodBodyFactory.cs | Removed .Import(module) calls in method body construction |
| InteropMethodRewriteFactory.ReturnValue.cs | Removed .Import(module) calls in method rewriting |
| InteropMethodRewriteFactory.RetVal.cs | Removed .Import(module) calls in return value handling |
| InteropMethodDefinitionFactory.*.cs (multiple files) | Removed .Import(module) calls throughout method definitions |
| InteropMemberDefinitionFactory.cs | Removed .Import(module) calls in member creation |
| InteropCustomAttributeFactory.cs | Removed .Import(module) calls in custom attribute creation |
| MethodDefinitionExtensions.cs | Removed .Import(module) call in constructor creation |
| ImportExtensions.cs | Deleted entire file containing manual import helper methods |
| WindowsRuntimeTypeHierarchyBuilder.cs | Removed .Import(module) calls in type hierarchy construction |
| InteropTypeDefinitionBuilder.*.cs (multiple files) | Removed module parameter from method signatures and .Import(module) calls throughout |
| DynamicCustomMappedTypeMapEntriesBuilder.cs | Removed .Import(module) call in type resolution |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d7e8792 to
1dfcb04
Compare
Bumps the AsmResolver.DotNet package version from 6.0.0-development.282 to 6.0.0-development.317 for improved features and bug fixes.
3499d99 to
8394812
Compare
Refactored code to eliminate unnecessary Import(module) calls when referencing interop types, methods, and signatures. This simplifies the code and improves readability, as most references are already in the correct context. No functional changes were made.
Deleted ImportExtensions.cs, which provided extension methods for importing metadata elements into modules. This may indicate a refactor or removal of unused code related to metadata import operations.
Removed redundant local variables and replaced them with direct usage of existing type and reference properties in marshaller method definitions. Updated method signatures and field assignments for clarity and consistency across Delegate, KeyValuePair, and Interface marshaller builders.
8394812 to
49f1f3d
Compare
Title. This also simplifies code a lot.