Skip to content

Conversation

@Sergio0694
Copy link
Member

Title. This also simplifies code a lot.

Copy link

Copilot AI left a 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 module parameter from several method signatures where it's no longer needed
  • Deleted the entire ImportExtensions.cs file 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.

@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/retval-marshalling-codegen branch from d7e8792 to 1dfcb04 Compare December 2, 2025 17:36
Base automatically changed from user/sergiopedri/retval-marshalling-codegen to staging/3.0 December 2, 2025 19:16
Bumps the AsmResolver.DotNet package version from 6.0.0-development.282 to 6.0.0-development.317 for improved features and bug fixes.
@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/asm-resolver-auto-import branch from 3499d99 to 8394812 Compare December 2, 2025 19:20
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.
@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/asm-resolver-auto-import branch from 8394812 to 49f1f3d Compare December 2, 2025 19:23
@Sergio0694 Sergio0694 marked this pull request as ready for review December 2, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants